Initial support of Unicode filenames

Martin Geisler mg at aragost.com
Thu Nov 3 04:31:28 CDT 2011


Victor Stinner <victor.stinner at haypocalc.com> writes:

> Le jeudi 3 novembre 2011 01:29:24, Victor Stinner a écrit :
>> If we store filenames are UTF-8, you would be able to share a
>> repository on a USB key between two Windows setup using different
>> ANSI code pages (e.g. cp1252 and cp932). You would also be able to
>> use the full Unicode range on Windows, not only a small subset (the
>> ANSI code page). For example, cp1252 contains 256 code points vs
>> 1.114.111 for Unicode 6.0).
>
> Oh, I forgot to mention the main "issue" of such feature: you cannot
> clone a repository containing non-ASCII filenames [...]

Small correction: you mean "checkout", not "clone" as cloning only
populates the .hg folder and we already have an ASCII encoding scheme
for that.

> Mercurial and Python cannot do anything to help this issue: it's a
> problem in the user's setup. If you work with users in a heterogenous
> environment, you have to limit yourself to ASCII. Well, I don't think
> that Mercurial 1.9 behaves better in such situation anyway...

That's the point: some people think it's better to checkout files with
broken filenames instead of refusing to checkout. Today, a Windows user
can commit a file named "Sweet crêpe recipe.txt" and I can checkout the
file on my Linux machine. I won't get a "ê" in my filename, but I'll get
a file I can modify and commit changes to anyway.

Personally, I think such a checkout is kind of broken and I agree with
you that Mercurial could abort in this case.

> Mac OS X and most Linux distro now use UTF-8 as the default locale
> encoding, so slowly everbody is moving to a fully Unicode compliant
> encoding (with an internal UTF-16 encoding for Windows).

(We already know this.) My Debian installation is old enough that I
still use a Latin-1 locale and it would be nice if Mercurial still
worked in that environment.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://mercurial.aragost.com/kick-start/


More information about the Mercurial-devel mailing list