Page MenuHomePhabricator

"arc diff" crashes when using against hg repo with non-ascii characters in commit messages on Windows
Closed, DuplicatePublic

Description

I have a problem with arc diff crashing with the following message:

Exception
ERR-CONDUIT-CORE: Invalid parameter information was passed to method 'differential.parsecommitmessage', could not decode
JSON serialization. Data: 0

Environment:
OS: Windows 7
repo: Mercurial

This only happens when there are commit messages in the hg repo which have non-ascii characters (e.g å,ä,ö).
I have double checked that they are actually stored correctly in the repo itself as UTF-8 double byte characters, and they are.
When trying to find out where it goes wrong, I found out that where it actually crashes is in ConduitClient::callMethod row 72: rPHU/src/conduit/ConduitClient.php#72; the json_encode seems to choke on the garbled text produced by mercurial and just return false.

I managed to get this working properly by injecting an explicit --encoding "UTF-8" into all the hg log commands in ArcanistMercurialAPI. I have no idea though if this messes things up for the linux crowd, or for everyone else but me for that matter.

I'm not sure how I would go about making a pull request or equivalent for this, any help or guidance would be appreciated if you deem this to be fix-worthy.

Event Timeline

ulrik.johansson assigned this task to epriestley.
ulrik.johansson raised the priority of this task from to Needs Triage.
ulrik.johansson updated the task description. (Show Details)
ulrik.johansson added a project: Arcanist.

I merged this into the main task. The core issue is json_encode can't handle non-utf8 data.