{"thread":{"id":"2484","subject":"Re: GIT character codecs","startedAt":"2005-11-13T08:14:43Z","lastAt":"2005-11-14T04:47:28Z","messageCount":4,"participants":["Marco Costalba","Junio C Hamano","Linus Torvalds","Matthias Urlichs"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"11719","messageId":"20051113081443.38296.qmail@web26309.mail.ukl.yahoo.com","threadId":"2484","inReplyTo":null,"subject":"Re: GIT character codecs","fromName":"Marco Costalba","fromEmail":"mcostalba@yahoo.it","sentAt":"2005-11-13T08:14:43Z","receivedAt":"2005-11-13T08:14:43Z","isPatch":false,"sender":{"key":"mcostalba@gmail.com","avatar":null},"body":"Junio C Hamano wrote:\n\n>Marco Costalba <mcostalba@yahoo.it> writes:\n>\n>>I modified qgit to force the use of utf-8 codec instead of the local one, \n>>in my case ISO-8859-15.\n>\n>\n>I suspect that trying to have a globa single encoding is a wrong\n>approach overall.  There are a handful issues to think about.\n>\n\nI agree.\n\n>First the easiest one -- the commit log messages.  We encourage\n>use of UTF-8, \n>\n> [cut]\n>\n>But we do not _enforce_ UTF-8.\n>\n>What this means for qgit is that it is often sufficient for its\n>log browser to support one encoding at a time, provided if it\n>allows the user to switch which encoding to use depending on\n>what project is being viewed.\n>\n>\n> [cut]\n>\n>\n>But other projects may use different\n>encodings, and even a single project can have its i18n message\n>files in different encodings and charsets in different files.\n>Users probably want to be able to view all of them, even if they\n>only understand a couple of languages and not others.\n>\n>What this means for qgit is that at least you should be able to\n>show a whole file in a single encoding, but if you show more\n>than two files at the same time, one in each window, these\n>windows may be showing its contents in different encodings and\n>charsets.  So you would need to give a way to your users to tell\n>you what encoding each file is in.  Using global locale as the\n>default and having a way to override that per file basis would\n>be sufficient.\n>\n\nIf encoding is a per-blob _and_ per-log message property a real solution, although cumbersone,\ncould be that git stores encoding togheter with the blob and the commits.\n\nThe interfaces to read out encoded info could be something like \n\ngit-rev-list --pretty  --encoding\ngit-ls-files -e\n\nfor commits and blobs respectively.\n\nThis avoids all user settings. More, the user could do not know the encoding, as\nexample when browsing a public repo. \n\n\nBut I understand is too late for something like this. So what qgit can do is\nto show a setting with a list of all supported encodings from the user to choose from.\n\nBut this is also a problem because, first we should have _two_ settings, one from log \nmessages and one from blobs _and_ also in this case we miss the problem of different \nblobs with different encoding.\n\nA practical workaround, *that do not catches all cases at all* could be qgit has only one global\nsetting (defaulting to local codec) and applies that setting blindly to everything, from commits\nto blobs, the user changes that setting and refreshes the view until he finds the correct one.\n\nBut I'm a bit reclutant to add this 'codec list' stuff because, as said, is *not* the real\nsolution.\n\n   Marco\n\n\n\n\n\t\t\n__________________________________ \nStart your day with Yahoo! - Make it your home page! \nhttp://www.yahoo.com/r/hs\n"},{"id":"11721","messageId":"7v3bm0c0gf.fsf@assigned-by-dhcp.cox.net","threadId":"2484","inReplyTo":"20051113081443.38296.qmail@web26309.mail.ukl.yahoo.com","subject":"Re: GIT character codecs","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2005-11-13T10:21:36Z","receivedAt":"2005-11-13T10:21:36Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marco Costalba <mcostalba@yahoo.it> writes:\n\n> But I'm a bit reclutant to add this 'codec list' stuff\n> because, as said, is *not* the real solution.\n\nWhy isn't it real?  UNIX files do not declare what encoding they\nare in, and people get their work done with existing viewing or\nediting tools (e.g.  vi, less, emacs, firefox [*1*], ...).  How\nis your situation any different?\n\nI suspect you could just take the default from LANG and LC_CTYPE\nto cover 98% of the cases, and to cover the rest 2% the\nproblematic cases have a per-window override menu.  If you first\nimplement only the locale support without per-window override\nand tell your users to set these environment variables to\niso-8859-15 when running qgit on your Italian project repository\n(or use utf-8 on git.git), wouldn't that be sufficient for most\neveryday uses?\n\n[Footnotes]\n\n*1* Ok, firefox is a bit different because they can read charset\nattribute from content type, but even so they have a manual\noverride from View->CharEncoding menu to let their users cope\nwith broken pages.\n"},{"id":"11735","messageId":"Pine.LNX.4.64.0511130948020.3263@g5.osdl.org","threadId":"2484","inReplyTo":"20051113081443.38296.qmail@web26309.mail.ukl.yahoo.com","subject":"Re: GIT character codecs","fromName":"Linus Torvalds","fromEmail":"torvalds@osdl.org","sentAt":"2005-11-13T17:51:56Z","receivedAt":"2005-11-13T17:51:56Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 13 Nov 2005, Marco Costalba wrote:\n> \n> If encoding is a per-blob _and_ per-log message property a real solution, although cumbersone,\n> could be that git stores encoding togheter with the blob and the commits.\n\nWe'd be much better off with just saying \"we encourage people to use \nutf-8, but if you don't, just set your locale to make things show up \nproperly\".\n\nutf-8 is clearly the future, and if we make git internally aware of \nlocales, that's just going to complicate things. And usually for no good \nreason, since users don't really care that much.\n\nI really hate codepages. I'd much rather say:\n - git is 8-bit clean, so you can use any damn encoding you want\n - utf-8 is strongly recommended for all the same reasons it's recommended \n   for anything else.\n\nHmm?\n\n\t\tLinus\n"},{"id":"11757","messageId":"pan.2005.11.14.04.47.25.899163@smurf.noris.de","threadId":"2484","inReplyTo":"7v3bm0c0gf.fsf@assigned-by-dhcp.cox.net","subject":"Re: GIT character codecs","fromName":"Matthias Urlichs","fromEmail":"smurf@smurf.noris.de","sentAt":"2005-11-14T04:47:28Z","receivedAt":"2005-11-14T04:47:28Z","isPatch":false,"sender":{"key":"matthias@urlichs.de","avatar":"https://gravatar.com/avatar/2708905af227313eba6f2b2ae0f7d0259b5ac5d71baef58fe5a13c699ce0bbf0?d=mp&s=160"},"body":"Hi, Junio C Hamano wrote:\n\n> I suspect you could just take the default from LANG and LC_CTYPE\n> to cover 98% of the cases, and to cover the rest 2% the\n> problematic cases have a per-window override menu.\n\nOr, if you want to be super-flexible, just try to decode as UTF-8.\nSuccess? fine -- otherwise use whatever your application's default is\nset to, or your local encoding (which may of course also be UTF-8), or\nfall back to 8859-15.\n\n-- \nMatthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de\nDisclaimer: The quote was selected randomly. Really. | http://smurf.noris.de\n - -\nDifficult:\n\tDisciplines like physics, math, engineering, which is why I don't\n\twant to do them.\n\t\t-- Fashionable Dictionary (www.butterfliesandwheels.com)\n"}]}