git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: gettext CTYPE for libc

From
Thomas Rast <tr@thomasrast.ch>
Date
Nov 24, 2013, 09:05 UTC
Message-ID
<874n72goem.fsf@linux-k42r.v.cablecom.net>
In-Reply-To
<52900FD6.5020202@gmail.com>
Trần Ngọc Quân <vnwildman@gmail.com> writes:
Show 5 quoted lines
> $ 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.
[...]
Show 18 quoted lines
> $ 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
Previous: Trần Ngọc QuânNext: Trần Ngọc Quân
Message 2 of 5 in “gettext CTYPE for libc”
  1. Trần Ngọc QuânNov 23, 2013
  2. Thomas RastNov 24, 2013
  3. Trần Ngọc QuânNov 25, 2013
  4. Duy NguyenNov 25, 2013
  5. Jonathan NiederNov 25, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.