{"thread":{"id":"10770","subject":"git-gui messes up the diff view on non ASCII characters","startedAt":"2007-11-09T15:49:35Z","lastAt":"2007-11-11T11:20:43Z","messageCount":4,"participants":["Peter Baumann","Michele Ballabio","Shawn O. Pearce","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"59067","messageId":"20071109154935.GC28800@xp.machine.xx","threadId":"10770","inReplyTo":null,"subject":"git-gui messes up the diff view on non ASCII characters","fromName":"Peter Baumann","fromEmail":"waste.manager@gmx.de","sentAt":"2007-11-09T15:49:35Z","receivedAt":"2007-11-09T15:49:35Z","isPatch":false,"sender":{"key":"waste.manager@gmx.de","avatar":null},"body":"I'm managing some UTF-8 encoded LaTeX files in git, which include some\nnon ASCII characters like the german ä,ö and ü. If I view the diff with\ngit-diff on an UTF8 enabled terminal, all looks nice. So does the diff\nview in gitk after I commited my changes. Only git-gui shows some\n\"strange\" characters, so I assume it is an encoding problem.\n\nI have to admit that I'm totally unaware how this should work, but at\nleast I think my configuration is correct here, because otherwise git-diff\nor gitk would show the same behaviour. Is there anything which could be\ndone to make git-gui happy, too?\n\n-Peter\n"},{"id":"59126","messageId":"200711092230.37905.barra_cuda@katamail.com","threadId":"10770","inReplyTo":"20071109154935.GC28800@xp.machine.xx","subject":"Re: git-gui messes up the diff view on non ASCII characters","fromName":"Michele Ballabio","fromEmail":"barra_cuda@katamail.com","sentAt":"2007-11-09T21:30:37Z","receivedAt":"2007-11-09T21:30:37Z","isPatch":false,"sender":{"key":"barra_cuda@katamail.com","avatar":"https://avatars.githubusercontent.com/u/16371673?v=4"},"body":"On Friday 09 November 2007, Peter Baumann wrote:\n> I'm managing some UTF-8 encoded LaTeX files in git, which include some\n> non ASCII characters like the german ä,ö and ü. If I view the diff with\n> git-diff on an UTF8 enabled terminal, all looks nice. So does the diff\n> view in gitk after I commited my changes. Only git-gui shows some\n> \"strange\" characters, so I assume it is an encoding problem.\n> \n> I have to admit that I'm totally unaware how this should work, but at\n> least I think my configuration is correct here, because otherwise git-diff\n> or gitk would show the same behaviour. Is there anything which could be\n> done to make git-gui happy, too?\n\nIt's a known issue, and already on Shawn's ToDo list. I have to add that\nviewing untracked UTF8 files in git-gui works just fine. Weird.\n"},{"id":"59271","messageId":"20071111055959.GW14735@spearce.org","threadId":"10770","inReplyTo":"200711092230.37905.barra_cuda@katamail.com","subject":"Re: git-gui messes up the diff view on non ASCII characters","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-11-11T05:59:59Z","receivedAt":"2007-11-11T05:59:59Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Michele Ballabio <barra_cuda@katamail.com> wrote:\n> On Friday 09 November 2007, Peter Baumann wrote:\n> > I'm managing some UTF-8 encoded LaTeX files in git, which include some\n> > non ASCII characters like the german ä,ö and ü. If I view the diff with\n> > git-diff on an UTF8 enabled terminal, all looks nice. So does the diff\n> > view in gitk after I commited my changes. Only git-gui shows some\n> > \"strange\" characters, so I assume it is an encoding problem.\n> > \n> > I have to admit that I'm totally unaware how this should work, but at\n> > least I think my configuration is correct here, because otherwise git-diff\n> > or gitk would show the same behaviour. Is there anything which could be\n> > done to make git-gui happy, too?\n> \n> It's a known issue, and already on Shawn's ToDo list. I have to add that\n> viewing untracked UTF8 files in git-gui works just fine. Weird.\n\nCute.  That's because in the untracked case we open the file and\nlet the platform's chosen encoding be used to convert it into the\ntext viewer.  In the tracked diff case we force the encoding to\nbe in binary.\n\nNow gitk works because it assumes the diff is in the same character\nencoding as the commit message itself.  Since commit messages are\ntypically in UTF-8 (as that is the Git default encoding) then a\nUTF-8 encoded file shows correctly in gitk.\n\nWhat's the right behavior here?  Just assume the platform encoding\nis correct for the file we are showing and show it?  Assume the\ncommit encoding configured in i18n.commitencoding is the correct\none for the file content?  Something else?\n\n-- \nShawn.\n"},{"id":"59311","messageId":"Pine.LNX.4.64.0711111120120.4362@racer.site","threadId":"10770","inReplyTo":"20071111055959.GW14735@spearce.org","subject":"Re: git-gui messes up the diff view on non ASCII characters","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-11-11T11:20:43Z","receivedAt":"2007-11-11T11:20:43Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 11 Nov 2007, Shawn O. Pearce wrote:\n\n> Michele Ballabio <barra_cuda@katamail.com> wrote:\n> > On Friday 09 November 2007, Peter Baumann wrote:\n> > > I'm managing some UTF-8 encoded LaTeX files in git, which include some\n> > > non ASCII characters like the german ä,ö and ü. If I view the diff with\n> > > git-diff on an UTF8 enabled terminal, all looks nice. So does the diff\n> > > view in gitk after I commited my changes. Only git-gui shows some\n> > > \"strange\" characters, so I assume it is an encoding problem.\n> > > \n> > > I have to admit that I'm totally unaware how this should work, but at\n> > > least I think my configuration is correct here, because otherwise git-diff\n> > > or gitk would show the same behaviour. Is there anything which could be\n> > > done to make git-gui happy, too?\n> > \n> > It's a known issue, and already on Shawn's ToDo list. I have to add that\n> > viewing untracked UTF8 files in git-gui works just fine. Weird.\n> \n> Cute.  That's because in the untracked case we open the file and\n> let the platform's chosen encoding be used to convert it into the\n> text viewer.  In the tracked diff case we force the encoding to\n> be in binary.\n> \n> Now gitk works because it assumes the diff is in the same character\n> encoding as the commit message itself.  Since commit messages are\n> typically in UTF-8 (as that is the Git default encoding) then a\n> UTF-8 encoded file shows correctly in gitk.\n> \n> What's the right behavior here?  Just assume the platform encoding\n> is correct for the file we are showing and show it?  Assume the\n> commit encoding configured in i18n.commitencoding is the correct\n> one for the file content?  Something else?\n\nMy twopence: assume utf-8, but make it a _git-gui_ config variable.\n\nCiao,\nDscho\n"}]}