[PATCH 6 of 6 STABLE V3] i18n: use encoding.lower/upper for encoding aware case folding

Matt Mackall mpm at selenic.com
Tue Dec 13 14:45:02 CST 2011


On Mon, 2011-12-12 at 22:25 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> # Date 1323677419 -32400
> # Branch stable
> # Node ID b337a7d848538a5179ea74cb4ec3d23169b6116c
> # Parent  22ae1ea19de2966fe4b13a049a25403cdf1bd8ab
> i18n: use encoding.lower/upper for encoding aware case folding
> 
> this patch uses encoding.lower/upper for case folding, because ones of
> str can not fold case of non ascii characters correctly.

>  # os.path.normcase is a no-op, which doesn't help us on non-native filesystems
>  def normcase(path):
> -    return path.upper()
> +    return encodingupper(path)

Doing this on POSIX is evil and wrong. Again, _we do not know the
encoding of filenames on POSIX_.

Perhaps you want this for Cygwin, which means you'll need to make a
Cygwin-specific hack.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list