From: Johannes Sixt Date: Mon, 02 Mar 2009 12:34:19 GMT Subject: Re: [RFC PATCH] Windows: Assume all file names to be UTF-8 encoded. Message-ID: <49ABD24B.5060005@viscovery.net> In-Reply-To: Peter Krefting schrieb: > 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