{"thread":{"id":"27990","subject":"filenames in repo are in CP1251; I have linux and UTF-8","startedAt":"2011-08-02T07:54:14Z","lastAt":"2011-08-02T13:02:01Z","messageCount":2,"participants":["Ilya Basin","Dmitry Potapov"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"172636","messageId":"1167098359.20110802115414@gmail.com","threadId":"27990","inReplyTo":null,"subject":"filenames in repo are in CP1251; I have linux and UTF-8","fromName":"Ilya Basin","fromEmail":"basinilya@gmail.com","sentAt":"2011-08-02T07:54:14Z","receivedAt":"2011-08-02T07:54:14Z","isPatch":false,"sender":{"key":"basinilya@gmail.com","avatar":null},"body":"Hi list! Most of our developers use msysgit which stores filenames in\nCP1251 encoding. Two of us use cygwin and linux.\n\nWhen checkout on both linux and cygwin, Russian filenames are garbled.\n\nOn Cygwin it even worse, because the conversion of invalid UTF-8 chars\nto Unicode, made by Cygwin is irreversible, causing git to miss\nthe files it've just checked out. Workaround for Cygwin is to change\nLANG from \"C.UTF-8\" to \"ru_RU.CP1251\". It fixes filenames, but brakes\neverything else: log (fixed by i18n.logOutputEncoding), status, show,\ndiff\n\nUnlike on Cygwin, LANG has no effect for git filenames on Linux. Good\nthing, there's no conversion to unicode, so files aren't lost at\ncheckout.\n\nQuestion: is there a way to tell git on Linux to use UTF-8 filenames\nfor the working tree, while storing them in CP1251?\n"},{"id":"172654","messageId":"CAHkcoti0G9gfHG3oiTXT0Cd3t8nnb_be90Zw-YPrjPECsR+jqQ@mail.gmail.com","threadId":"27990","inReplyTo":"1167098359.20110802115414@gmail.com","subject":"Re: filenames in repo are in CP1251; I have linux and UTF-8","fromName":"Dmitry Potapov","fromEmail":"dpotapov@gmail.com","sentAt":"2011-08-02T13:02:01Z","receivedAt":"2011-08-02T13:02:01Z","isPatch":false,"sender":{"key":"dpotapov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6568595?v=4"},"body":"Hi!\n\nOn Tue, Aug 2, 2011 at 11:54 AM, Ilya Basin <basinilya@gmail.com> wrote:\n>\n> Unlike on Cygwin, LANG has no effect for git filenames on Linux. Good\n> thing, there's no conversion to unicode, so files aren't lost at\n> checkout.\n\nLANG has no effect on open() or other system functions on Linux, so\nall filenames are created as they were stored in Git, in your case,\nit is CP1251.\n\nAFAIK, it should not be difficult to configure CP1251 on Linux. You\ngenerate the required locale and then start xterm with this locale\nand specifying some CP1251 font.\n\nI have never done it before, but the following steps seem to work:\n\n# generate CP1251\nsudo localedef -c -i ru_RU -f CP1251 ru_RU.CP1251\n\n# make sure that it was generated\n# you should see ru_RU.cp1251 in the output\nlocale -a | grep ru_RU\n\n# start xterm\nLANG=ru_RU.cp1251 xterm -fn '-monotype-courier\nnew-semilight-r-normal--0-0-0-0-c-0-microsoft-cp1251' &\n\nYou can try another font. See the output of xlsfonts:\n  xlsfonts | grep -i cp1251\n\n>\n> Question: is there a way to tell git on Linux to use UTF-8 filenames\n> for the working tree, while storing them in CP1251?\n\nThe short answer is no. A more detail answer is that there was\na series of patches that should allow filename conversation:\n\nhttp://article.gmane.org/gmane.comp.version-control.git/119224\n\nbut a proper implementation turned out to be very invasive and\nno one seems to care about it very deeply, so it was dropped.\nSee details here:\n\nhttp://article.gmane.org/gmane.comp.version-control.git/122860\n\n\nDmitry\n"}]}