9

The question might be quite dumb in the end, but...

I have a local GIT repo in a Win 7 environment, working with GIT in Windows command line. All the files are in UTF-8 (no BOM), texts contain non-ASCII symbols (German, Russian, etc...), so do commit messages. At some moment I needed to recall some data from past commits, which is in non-ASCII symbols. But both gitk and git checkout <commit-hash> show the files in non-UTF-8 encoding (default ANSI according to Notepad++), of course breaking UTF-8-only symbols. Cheking out back to HEAD restores files' encoding.

Am I missing something? Maybe some GIT settings need to be made. My guess is that git files are non-UTF-8 and thus can't have such symbols.

I also have to mention non-ASCII commit messages work fine (git log and gitk show them properly although I didn't change the cmd endoding).

Thanks!


Edit: here is what the my files look like in gitk or when checked out (notice the characters in the comment line):

@import 'reset';
@import 'mixins';
@import 'animations';
@import 'variables';
@import 'helpers';

/* ==================== Шрифты ==================== */
@font-face{
    font-family:'ClearSans';
    src:url('../fonts/ClearSans-Medium.eot');
    src:url('../fonts/ClearSans-Medium.eot?#iefix') format('embedded-opentype'),
         url('../fonts/ClearSans-Medium.woff') format('woff'),
         url('../fonts/ClearSans-Medium.ttf') format('truetype'),
         url('../fonts/ClearSans-Medium.svg') format('svg');
    font-weight:normal;
    font-style:normal;
}
bonflash
  • 714
  • 6
  • 17
  • Have a look at http://stackoverflow.com/q/170961/1860929 – Anshul Goyal Sep 13 '14 at 06:45
  • @mu無 thanks, an interesting moment, but I don't have a problem with new lines (in fact I have all of them are Unix-like). – bonflash Sep 13 '14 at 13:24
  • Can you share the repository? Which Git version are you using? Are the files valid UTF-8 after checkout or are they actually corrupted? Maybe only your editor is detecting the wrong encoding due to imperfect heuristics (the actual encoding is _not_ stored with the file). If you manually force the encoding in your editor, do the files become legible? – knittl Sep 20 '21 at 17:46

0 Answers0