Issue #1719 resolved

Settings Editor saves mercurial.ini in UTF8

Anonymous created an issue

When trying to integrate our tool (ECMerge) with Mercurial, we tried to configure ECMerge as the differ and merger.

The graphical user interface considers the RC file and the .ini files as UTF8 files without signature. But Mercurial itself consider them as being coded in "local code page" (CP1252 here), if any accent is in the configuration file, Mercurial misbehaves (an accent 'é' in a path will be transformed to the matching UTF8 sequence and the program is not found).

Comments (8)

  1. Anonymous

    --TortoiseHg-- saves its configuration (mercurial.ini) file as UTF8 without BOM, whereas Mercurial does not expect that. Of course for English only files names/paths it does not matter but for languages with accents it does. Our merge tool is just sometimes installed by users with an accent in the path (because our company has an accent in its name).

  2. Anonymous

    BTW, method to reproduce:

    • open TortoiseHg / Settings
    • click "Edit the file" (Editer le fichier in French) button
    • add some "é" and save
    • open mercurial.ini in a binary editor
    • the é shows as é (that is the UTF8 encoding of é as seen in CP1252)

    hope it helps.

  3. Ewen Wallace

    Related but perhaps a separate issue. If the mercurial.ini target is actually a symbolic link (I use dropbox to sync settings across PCs) then the Workbench overwrites the symlink with the actual file. This is probably (a guess) also something to do with QsciScintilla.write()

  4. Yuya Nishihara

    qscilib: convert to local encoding on reading/writing file (fixes #1719)

    QsciScintilla.read() and write() do not convert character encoding. Editing it will mess up the content because the GUI encoding is UTF-8.

    Currently readFile() has no except block because hglib.tounicode() never raise exception.

    → <<cset 01099e9c05ec>>

  5. Log in to comment