3 ms·
No it can’t, because of the following two things: (1) Not all source or text files are Unicode, I can’t assign an extension. (2) I’m running Windows, I don’t ha
by Const-me 11y ago
No it can’t, because of the following two things: (1) Not all source or text files are Unicode, I can’t assign an extension. (2) I’m running Windows, I don’t have terminal, I use git from power shell. And power shell’s native encoding is already UTF-16.
- dkuntz2 11y agoPowershell is a terminal?
- viraptor 11y agoAs mentioned in other comments - powershell terminal is your terminal. As for the issue - if you can't define what files have what encoding, how do you expect git to know it? What you can do is apply the binary filter I posted to all files and write a script which attempts to guess encoding and then translates that to utf16 with iconv. But expect funny failures from time to time (sometimes more than one decode may be valid)
- Const-me 11y ago“if you can't define what files have what encoding” — I can, but not by name or extension. See this: http://unicode.org/faq/utf_bom.html#bom1 http://unicode.org/faq/utf_bom.html#bom1 “you can do is apply the binary filter I posted to all files and write a script” — yes, I know git is open source and very flexible. But Unicode is 20 years old standard widely accepted by the industry. Git should support Unicode out of the box, without my custom scripts.