You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
non-UTF8 characters are not rendered correctly in Changes and History diff #3923
When a source file contains some character that does not appear in the current locale, but the related language package is installed, those code are rendered correctly if you read the diff in Changes tab, but they are not rendered correctly if you read the diff in History tab.
The point is that, if everything is handled correctly in Changes diff, why not do it correctly again in History diff?
Version
GitHub Desktop version: 1.0.13
OS version: Microsoft Windows [Version 10.0.16299.192]
Steps to Reproduce
Set your computer's locale to english
Install Chinese language package
Type some Chinese character to your code
You can see diff shows Chinese characters when you are reading diff from Changes tab
Commit it
Open History tab and read the diff, those Chinese characters are rendered as unrecognizable symbols
Expected behavior: Character correctly rendered (see repro steps for details)
Actual behavior: Character incorrectly rendered (see repro steps for details)
Reproduces how often: 100%
Logs
This is not a crash so I don't think log helps.
Additional Information
You can use Github Desktop to read this change: vczh-libraries/GacUI@92945be , remember to install Chinese language pack while keeping your computer in English. Undo this commit and see things just work in Changes tab, but not in History tab.
Reacted by Hüseyin Yağlı, Dmitry Galashin, Adam Waller, Sandro Silveira, Vanius Bittencourt, iPwnXX, Jay Wu (Jiahao), rehti02, James, Vico and 1 more
Yes, I went ahead and tried to see if I could reproduce on macOS to rule it out. I'm having trouble with my Windows VM, but I intend to check this out there as well.
Confirmed the problem commit vczh-libraries/GacUI@92945be does not render correctly in Desktop for Windows and macOS, so I think we need to figure out a way to drop this constraint on rendering UTF-8 diffs.
@shiftkey, if we go the route of not requiring strings be encoded as utf-8, wouldn't we have to surface the encoding types to the user? or is there some way for toString to be overridden in such a way as to allow for arbitrary encoding types and picking the right one?
I have some problems with displaying characters in the GitHub Desktop. My file vers.info is in cp1251 encoding. And .gitattributes contains the next line "*.info working-tree-encoding=C
P1251 eol=CRLF". In the new part of the file i see correct cyrillic characters, but in the old part I see question signs inside diamonds on the cyrillic characters places.
I'm not sure that it's just a problem with History. I'm getting this on viewing uncommited changes on a UTF-8 file CSV (without BOM) with diacritics. Is it simply Windows 10 being told to use a font that doesn't have enough glyphs?
I have the exact same situation: some characters are showing up as a question mark, in a CSV file, in ansi format. If I use a UTF8 file, there is no problem.
I am using Windows 10.
The language is set to Korean.
When my file is of the "Ansi" type, there is an issue where Korean comments break due to the same problem.
I confirmed that after changing the problematic file to the UTF-8 type, the Korean comments no longer break.
I recommend a tool or method to change file encoding to UTF-8.
However, support is needed to ensure that characters do not break, regardless of the type of file.
Is still an issue for me - i sometimes do things in PAWN for Open.MP (a spiritual sucessor of SA:MP) that requires the source files to be encoded as Windows-1252 (ANSI). Diffs of those files always show the accents with the "?" character.
Activity
iAmWillShepherd commentedon Feb 5, 2018
Thanks for taking the time to open an issue! 🙇
I was unable to reproduce this problem on my computer (macOS).
vczh commentedon Feb 5, 2018
@iAmWillShepherd I am using Windows 10 which is mentioned in the description.
iAmWillShepherd commentedon Feb 5, 2018
Yes, I went ahead and tried to see if I could reproduce on macOS to rule it out. I'm having trouble with my Windows VM, but I intend to check this out there as well.
iAmWillShepherd commentedon Feb 23, 2018
@vczh I was unable to reproduce on Windows 10 as well.
shiftkey commentedon Feb 26, 2018
@iAmWillShepherd could there be something in the problem repository and commits like this that are different to your setups? vczh-libraries/GacUI@92945be
iAmWillShepherd commentedon Feb 26, 2018
@shiftkey Yes, I saved all files with the
utf-8encoding. Any other encoding produces blocks.I found the code that show's we assume the diff is
utf-8encoded. That may be the issue here.desktop/app/src/lib/git/diff.ts
Lines 358 to 361 in c464fff
shiftkey commentedon Apr 9, 2018
Confirmed the problem commit vczh-libraries/GacUI@92945be does not render correctly in Desktop for Windows and macOS, so I think we need to figure out a way to drop this constraint on rendering UTF-8 diffs.
iAmWillShepherd commentedon Apr 10, 2018
@shiftkey, if we go the route of not requiring strings be encoded as utf-8, wouldn't we have to surface the encoding types to the user? or is there some way for
toStringto be overridden in such a way as to allow for arbitrary encoding types and picking the right one?shiftkey commentedon Apr 10, 2018
@iAmWillShepherd yeah, this basically means encoding detection and/or overriding support not unlike #1607
vczh commentedon Apr 11, 2018
There should be a library to determine (or guess) the encoding from a given stream for JavaScript, like this API IsTextUnicode.
17 remaining items
mlferreira151276 commentedon Apr 13, 2022
I'm working with the latest version of Github Desktop and I still have problems with ANSI files
I'm working with the latest version of Github Desktop and I still have problems with ANSI files
arvanus commentedon Nov 17, 2022
Same problem here, any idea of when a fix will be available? I'm using
git-guiwhen I commit chars likeáçãàü😢FozerG commentedon Nov 25, 2022
Cyrillic with Windows-1251 encoding is not displayed correctly.

steveward commentedon Nov 2, 2023
Another report in #17662.
steveward commentedon Jan 17, 2024
From #18030:
murchelon commentedon Aug 5, 2024
I have the exact same situation: some characters are showing up as a question mark, in a CSV file, in ansi format. If I use a UTF8 file, there is no problem.
steveward commentedon Nov 12, 2024
Reported in #19530.
UnrealKaraulov commentedon Feb 11, 2025
Same issue
how to fix it?
songshinyoung commentedon Mar 20, 2025
I am using Windows 10.
The language is set to Korean.
When my file is of the "Ansi" type, there is an issue where Korean comments break due to the same problem.
I confirmed that after changing the problematic file to the UTF-8 type, the Korean comments no longer break.
I recommend a tool or method to change file encoding to UTF-8.
However, support is needed to ensure that characters do not break, regardless of the type of file.
vico93 commentedon Sep 25, 2025
Is still an issue for me - i sometimes do things in PAWN for Open.MP (a spiritual sucessor of SA:MP) that requires the source files to be encoded as Windows-1252 (ANSI). Diffs of those files always show the accents with the "?" character.
wezzzyrek1 commentedon May 21, 2026
Same here. If file is encoded using ANSI charset then all breaks
In this case the file is encoded using 949 Korean. Changing gile encoding to UTF8 is not a solution in many cases, as we use 949 on purpose.
Decode diffs of files that are not UTF-8