{"thread":{"id":"31634","subject":"problem with setlocale trick in gettext.c","startedAt":"2012-09-24T14:08:57Z","lastAt":"2012-09-25T17:31:36Z","messageCount":2,"participants":["Nguyen Thai Ngoc Duy","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"199805","messageId":"CACsJy8A+YvdGc6LM5baFqHoB91p6TAjQ9kKXuaPspvL--mfe0Q@mail.gmail.com","threadId":"31634","inReplyTo":null,"subject":"problem with setlocale trick in gettext.c","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-09-24T14:08:57Z","receivedAt":"2012-09-24T14:08:57Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"Hi,\n\nI think the setlocale() trick in init_gettext_charset() messes up\nlocale support from library. Currently I get\n\nfatal: Could not switch to '/foo/': Kh?ng c? t?p tin ho?c th? m?c nh? v?y\n\nThe question marks are what I actually see. The point here is to call\nstrerrno(), which should return a l10n string. With this patch\n\ndiff --git a/gettext.c b/gettext.c\nindex 71e9545..eeb88c5 100644\n--- a/gettext.c\n+++ b/gettext.c\n@@ -115,7 +115,7 @@ static void init_gettext_charset(const char *domain)\n        setlocale(LC_CTYPE, \"\");\n        charset = locale_charset();\n        bind_textdomain_codeset(domain, charset);\n-       setlocale(LC_CTYPE, \"C\");\n+       //setlocale(LC_CTYPE, \"C\");\n }\n\n void git_setup_gettext(void)\n\nI get correct output again\n\nfatal: Could not switch to '/foo/': Không có tập tin hoặc thư mục như vậy\n\nAnybody knows how this happens?\n-- \nDuy\n"},{"id":"199899","messageId":"7va9wevwjr.fsf@alter.siamese.dyndns.org","threadId":"31634","inReplyTo":"CACsJy8A+YvdGc6LM5baFqHoB91p6TAjQ9kKXuaPspvL--mfe0Q@mail.gmail.com","subject":"Re: problem with setlocale trick in gettext.c","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-25T17:31:36Z","receivedAt":"2012-09-25T17:31:36Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:\n\n> I think the setlocale() trick in init_gettext_charset() messes up\n> locale support from library. Currently I get\n>\n> fatal: Could not switch to '/foo/': Kh?ng c? t?p tin ho?c th? m?c nh? v?y\n\nThat pretty much matches what the big comment before your patch\ndisables, doesn't it?  Could it be that newer/older libc differ\nin the behaviour around this code?\n"}]}