Clone wiki

TortoiseHg / Home

TortoiseHg Windows Explorer (shell) extensions for fixutf8 extension

Japanese(日本語) はこちら

Abstract

FixUtf8 extension is broken on TortoiseHg 2.2 (Mercurial 2.0). Please use TortoiseHg 2.1.4 (Mercurial 1.9.3).

http://mercurial.selenic.com/bts/issue3094

TortoiseHg 2.2 Windows shellext has Unicode porting. You don't need to download these dlls if you don't activate FixUtf8 extension.

I merged following jobs.

Details

Before

fixutf8-before.70.png

After

fixutf8-after.70.png

issue 672: shell extension unicode support

TortoiseHg (thg) support Windows explorer menu for fixutf8 extension in following revisions.

hgqt/run.py

Reference

Logic

As the image of architecture, encoding of .hg/dirstate and .hg/thgstatus is following.

  1. If FixUtf8 extension is enabled, encoding is UTF-8.
  2. If FixUtf8 extension is not enabled, encoding is CP_ACP(ANSI code pages / Windows code pages)

Logic of dll determining encoding is following.

  1. If UTF-8 is vaild, dll treats as UTF-8.
    You can skip this step to set environment variable THG_SHELLEXT_UTF8 false or no.
  2. If UTF-8 is invaild, dll treats as CP_ACP.

There is a possibility of miss handling of UTF-8. For example, "\xC2\x80" is two chars in latin-1 and it is valid UTF-8.

Install

Download dll

Replace dll

For 32 bits system

  1. Rename the THgShellx86.dll in "C:\Program Files\TortoiseHg" to something else (e.g. THgShell-01.dll)
  2. Copy the new dll to "C:\Program Files\TortoiseHg\THgShellx86.dll"
  3. (Option) Set environment variable THG_SHELLEXT_UTF8 false or no. Refer Logic
  4. Logout
  5. Login

For 64 bits systems, the dll is instead located in "C:\Program Files\Common Files\TortoiseHg\ThgShellx64.dll".

For more details, please refer README.txt

Architecture

thg.png

pdf / OpenOffice Draw

win32/shellext/StringUtils.cpp

Story

Build dlls

Please refer README.txt

Reference

http://mercurial.selenic.com/wiki/EncodingStrategy

Updated