#38 ✓resolved
Johannes Gilger

GitX doesn't display commits with encodings other than UTF-8

Reported by Johannes Gilger | December 7th, 2008 @ 12:12 PM

gitx seems to be having trouble showing the date and diff of commits in which german umlauts (äüö etc.) appear. The detailed view doesn't stop loading and the raw view displays nothing at all.

Steps to reproduce: - git clone http://avalon.hoffentlich.net/~h... - run gitx on it.

I'm using gitx 0.5 and git version 1.6.1.rc1.56.g2dd62 (have tried it on another git version before) with MacOS 10.5.5

Comments and changes to this ticket

  • Mark Bestley

    Mark Bestley December 8th, 2008 @ 10:02 PM

    I had a look at the sample file and opened it in TextEdit

    It only displayed the umlauts if I opened with encoding Windows Latin-1 If I used UTF-8 TextEdit refused to open it as it said the encoding was not applicable. I could open it in Mac-OS Roman but the text showed as ‰¸ˆfl (which looks to me as per mille symbol, comma, circumflex and lastly florin symbol fl as one symbol.

    What Gitx is doing is opening the file as UTF-8 encoded and getting a nil back from NSString - (id)initWithBytes:(const void *)bytes length:(NSUInteger)length encoding:(NSStringEncoding)encoding which I assume is the same as TextEdit did.

    So I think the the question is what encoding should we read the file in as and how do we know which one to use.

    Mark

  • Johannes Gilger

    Johannes Gilger December 9th, 2008 @ 12:34 PM

    Yep, probably should've included this before. I edited the file with vim and encoding set to latin1. I'm absolutely not proficient in Objective-C (anymore), so no idea how to solve this ;)

  • Pieter de Bie

    Pieter de Bie December 10th, 2008 @ 03:07 PM

    • State changed from “new” to “open”

    As you have correctly discovered yourselves, GitX tries to load in commits using the UTF-8 encoding. German umlauts should be no problem, as long as you use UTF-8 and not older encodings like Latin-1.

    In general, it's hard to figure out the exact encoding. Git does offer and encoding attribute you can set with gitattributes (see 'man gitattributes'), to give a hint on the encoding. GitX currently does not read that attribute, so even if you have it set, GitX will fail.

    Another option is to fall back on some legacy encoding, like plain ASCII. In that case your umlauts will not display correctly, but the other text will. I'm very much in favor of implementing this at least, because other parts of GitX try to do the same. Adding this should be no more than a few lines of code, and the attribute part can be implemented later.

  • Pieter de Bie

    Pieter de Bie December 10th, 2008 @ 03:09 PM

    • Title changed from “gitx doesn't load/display commits with german umlauts” to “GitX doesn't display commits with encodings other than UTF-8”
  • davetron5000 (at gmail)

    davetron5000 (at gmail) December 10th, 2008 @ 03:11 PM

    • Title changed from “GitX doesn't display commits with encodings other than UTF-8” to “gitx doesn't load/display commits with german umlauts”

    In terms of #39 (which was just closed as invalid) I think an orthogonal issue to this is the general handling of files with these characters; in my case the commit seems to never load; I'll take invalid characters over not loading any day.

  • Johannes Gilger

    Johannes Gilger December 11th, 2008 @ 08:45 PM

    Yep. The umlauts are displayed as garbage in some terminals as well (depending on the locale/lc-setting and the terminal type), but that doesn't annoy me at all.

  • Johannes Gilger

    Johannes Gilger December 11th, 2008 @ 08:46 PM

    • Title changed from “gitx doesn't load/display commits with german umlauts” to “GitX doesn't display commits with encodings other than UTF-8”
  • Pieter de Bie

    Pieter de Bie December 15th, 2008 @ 06:01 PM

    • State changed from “open” to “resolved”

    This is fixed in 530377a121 (PBEasyPipe: Fall back to ASCII encoding when UTF-8 fails).

    Thanks all for the bug and test cases

  • Johannes Gilger

    Johannes Gilger December 25th, 2008 @ 06:26 PM

    While the issue was resolved for the raw-view and diff-view it still persists in tree-view when trying to view files with umlauts in them. Just noticed it, otherwise I would have mentioned it earlier. Also didn't want to open a new bug, since these are related.

  • Johannes Gilger

    Johannes Gilger December 25th, 2008 @ 08:36 PM

    Ok, I solved the problem for the Tree-View (by doing exactly what Pieter did for the original problem). The commit is in my github-fork.

  • ronw1309

    ronw1309 September 12th, 2018 @ 11:50 AM

    While the issue was resolved for the raw-view and diff-view it still persists in tree-view when trying to view files with umlauts in them. Just noticed it, otherwise I would have mentioned it earlier. Also didn't want to open a new bug, since these are related.
    Latest Kickass Torrent Mirror SitesLatest Rarbg Torrent Mirror SitesBest Radar Detectors On Amazon 2018Latest Front And Rear Dash Cam On Amazon While the issue was resolved for the raw-view and diff-view it still persists in tree-view when trying to view files with umlauts in them. Just noticed it, otherwise I would have mentioned it earlier. Also didn't want to open a new bug, since these are related.

  • serdavos

    serdavos September 14th, 2018 @ 02:07 PM

    While the issue was resolved for the raw-view and diff-view it still persists in tree-view when trying to view files with umlauts in them. Just noticed it, otherwise I would have mentioned it earlier. Also didn't want to open a new bug, since these are related.
    Websiteswebsite While the issue was resolved for the raw-view and diff-view it still persists in tree-view when trying to view files with umlauts in them. Just noticed it, otherwise I would have mentioned it earlier. Also didn't want to open a new bug, since these are related.

  • Jason Holder

    Jason Holder November 1st, 2018 @ 09:29 AM

    Hello guys if you are new for this website and more user are go to this website http://bingrewards.info are online you are join the search engine you are now to come the search engine. and earn the true information.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

GitX is the nice-looking gitk clone for OS X

Referenced by

Pages