Can't commit unicode filenames on Windows

anatoly techtonik techtonik at gmail.com
Mon Oct 12 07:11:55 UTC 2015


Hi. Please, CC.

I've got a bug report [1] that my remote download package (hosted on
BBHG) is unable to save unicode filenames. And after fixing the bug
I found that I can not commit the test file which is named:

    یـــــــــاد.zip

Git was able to add the file and commit, and checkout it successfully:

    >hg add یـــــــــاد.zip
    ????????????.zip: The filename, directory name, or volume label syntax
is incorrect

    >git add -vvv یـــــــــاد.zip
    add 'یـــــــــاد.zip'

I remember Matt or somebody was telling me about the deep
problem with hg code, unicode and Python, but I can't find the letter.
If somebody can recall it, Mercurial code, please tell me.

Putting deep problems aside, this specific problem starts with
Python 2 treating sys.argv elements as 'ascii` strings under Windows.
I've just committed fix for that to another project of mine and just in
case that I won't have time to find a place where to inject the patch in
Mercurial, here is the code:

https://github.com/techtonik/RHVoice/commit/cb99b4ebb89ba158aed448dca551bf476e772ab9

I don't see a reference to GetCommandLineW in Mercurial code, so
I think this should be applied.

1. https://bitbucket.org/techtonik/python-wget/issues/7/filename-issue

-- 
anatoly t.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial/attachments/20151012/152ea0c7/attachment.html>


More information about the Mercurial mailing list