Re: gettext CTYPE for libc

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: gettext CTYPE for libc

From: Thomas Rast <hidden>
Date: 2016-06-15 22:59:18

Trần Ngọc Quân [off-list ref] writes:
$ git status
fatal: Unable to read current working directory: Kh?ng c? t?p tin ho?c
th? m?c nh? v?y

So, somthing wrong with our charset.
[...]
quoted hunk
$ gettext --domain=libc "No such file or directory"
Không có tập tin hoặc thư mục như vậy

in git's gettext.c, it not allow CTYPE="" for all domain, so we will set
this one individually. In this ex. I set it for libc:

$ git diff
diff --git a/gettext.c b/gettext.c
index 71e9545..abd3978 100644
--- a/gettext.c
+++ b/gettext.c
@@ -115,6 +115,7 @@ static void init_gettext_charset(const char *domain)
        setlocale(LC_CTYPE, "");
        charset = locale_charset();
        bind_textdomain_codeset(domain, charset);
+       bind_textdomain_codeset("libc", charset);
        setlocale(LC_CTYPE, "C");
 }
Do you know why this "suddenly" broke?  The long comment in
init_gettext_charset() suggests that the *existing* code is there to
handle exactly this problem, and apparently it doesn't.  Why?  Has libc
moved the perror() strings into a separate domain in some version?

-- 
Thomas Rast
tr@thomasrast.ch

Re: gettext CTYPE for libc

From: Trần Ngọc Quân <hidden>
Date: 2016-06-15 22:59:19

On 24/11/2013 16:05, Thomas Rast wrote:
Trần Ngọc Quân [off-list ref] writes:
quoted
$ git status
fatal: Unable to read current working directory: Kh?ng c? t?p tin ho?c
th? m?c nh? v?y

So, somthing wrong with our charset.
[...]
Do you know why this "suddenly" broke?
I think git set CTYPE="C" for libc, so charset become  7-bit ASCII, but
it don't set LC_MESSAGES="C" for libc and libc will get this one from
system variable.
The long comment in
init_gettext_charset() suggests that the *existing* code is there to
handle exactly this problem, and apparently it doesn't.  Why?  Has libc
moved the perror() strings into a separate domain in some version?
See setlocale(3) [1]
I'm a newbie in GIT. I'm not sure about git work correctly [2] if set
git's charset to same with system.
I don't think libc moved perror() string in separate domain. It use its
own domain.

[1]  http://man7.org/linux/man-pages/man3/setlocale.3.html
[2]  incorrect if some function need work in ASCII mode

-- 
Trần Ngọc Quân.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help