Thread (14 messages) flat view 14 messages, 5 authors, 2016-06-15

Re: [RFC PATCH] Windows: Assume all file names to be UTF-8 encoded.

From: Johannes Sixt <hidden>
Date: 2016-06-15 22:46:18

Peter Krefting schrieb:
Johannes Sixt:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help