Non-ASCII characters in user info aren't stored correctly
By ajrie... on June 12, 2010 03:06 (imported from Google Code)
What steps will reproduce the problem?
- In a Windows Explorer window, right-click on a directory under version control and select the option "TortoiseGit -> Settings"
- In the Git->Config section enter the user info name "José" (note the accented é)
- Click OK to save the changes.
- Repeat step 1, go to the Git->Config section again and check the stored user name. It is now "Jos".
What is the expected output? What do you see instead?
I would expect my user name to stay as "José", retaining the non-ASCII character.
What version of the product are you using? On what operating system?
git version 220.127.116.11.msysgit.0
Please provide any additional information below.
I took a second test using the user name "李安和". In this case, the name became "???" when I re-opened the Settings dialog.
Actually, I have found that msysgit and TortoiseGit have a lot of problems with non-ASCII characters, not only this particular problem I am describing here (I can give more details if anyone is interested). Such problems are even worse when using Git GUI, so I'm not sure if the problem is in the TortoiseGit layer or in the underlying msysgit representation.
My guess is that TortoiseGit must be using some mechanism based on the Win32 API to read and write from the edit boxes in the dialog, and maybe it should translate between wide-character UTF-16-encoded strings, as used by the Win32 API, and the multibyte UTF-8-encoded strings that msysgit presumably uses. Just an idea, not sure if it makes sense.