[PATCH] win32mbcs: wrap two more functions

Shun-ichi Goto shunichi.goto at gmail.com
Wed Jul 6 12:06:33 CDT 2011


2011/7/7 Matt Mackall <mpm at selenic.com>:
> On Wed, 2011-07-06 at 18:29 +0900, Shun-ichi Goto wrote:
>> # HG changeset patch
>> # User Shun-ichi GOTO <shunichi.goto at gmail.com>
>> # Date 1309944522 -32400
>> # Node ID d6d0b2cf9ff050e9bc8e018221ffd5b62dc2df77
>> # Parent  4b58d9402c435ebcf8cae63b27ab653ab54d1796
>> win32mbcs: wrap two more functions to be wrapped.
>
> Queued for stable, thanks.

Thanks.

By the way, this patch raises an another issue.
It may cause UnicodeDecodeError when message in checkwinfilename() is
localized to non-ASCII text.

Because win32mbcs wraps it to pass argument 'path' as unicode,
'c' and 'base' in checkwinfilename() is also unicode.
When _("filename contains '%s', ...") goes local mbcs bytes,
  "mbcs-bytes" % c
cause decoding "mbcs-bytes" with ASCII encoding, then generates
UnicodeDecodeError.

Do you have any good idea to avoid this issue?
Do we need to arrange checkwinfilename()?

-- 
Shun-ichi GOTO


More information about the Mercurial-devel mailing list