Re: [RFC PATCH] Windows: Assume all file names to be UTF-8 encoded.
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Mar 2, 2009, 12:34 UTC
- Message-ID
- <49ABD24B.5060005@viscovery.net>
- In-Reply-To
- <alpine.DEB.2.00.0903021137110.17877@perkele.intern.softwolves.pp.se>
Peter Krefting schrieb:
Show 8 quoted lines
> Johannes Sixt: >> If git prints a file name under the assumption that it is UTF-8 >> encoded, then it will be displayed incorrectly because the system uses >> a different encoding. > > Here setting the local codepage to UTF-8 *might* work, although I > haven't tested that. Or always use the wchar_t versions of printf and > friends.
You cannot expect users to switch the locale. For example, I have to test our software with Japanese settings: I *cannot* switch to UTF-8 just because of git.
Can you set the local codepage per program? (I don't know.) It might help here, but it doesn't help in all cases, particularly in certain pipelines:
git ls-files -o git ls-files -o | git update-index --add --stdin find . -name \*.jpg | git update-index --add --stdin
- What encoding should 'ls-files' use for its output? Certainly not always UTF-8: stdout should use the local code page so that the file names are interpreted correctly by the terminal window (it expects the local code page).
- What encoding should 'update-index' expect from its input? Can you be sure that other programs generate UTF-8 output?
How do you solve that?
-- Hannes