bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: autoconf test for finding UTF-8 locale?


From: Bruno Haible
Subject: Re: autoconf test for finding UTF-8 locale?
Date: Mon, 21 Nov 2022 11:02:57 +0100

Hi Werner,

> I'm searching for an autoconf test that checks whether a 'neutral'
> locale with UTF-8 encoding is available.  Interestingly, the
> 'autoconf-archive' git repository doesn't have such a thing, which
> surprises me because many tools behave differently depending on
> one-byte or multi-byte encodings (for example, GNU `awk` or `perl`).
> 
> According to
> 
>   
> https://unix.stackexchange.com/questions/597962/how-widespread-is-the-c-utf-8-locale
> 
> I can't assume that 'C.UTF-8' is universally available; it seems that
> it is necessary to also check for 'en_US.UTF-8'.  How can this be done
> in a generic way that works on as many platforms as possible?

You can do so in a way similar to the Gnulib-provided macros
  gt_LOCALE_FR_UTF8 [1]
  gt_LOCALE_TR_UTF8 [2]
or the gettext internal macro
  gt_LOCALE_DE_UTF8 [3]

E.g. replace 'French_France'/'Turkish_Turkey'/'German_Germany' with
'English_United States'.

Bruno

[1] 
https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=m4/locale-fr.m4;h=3753891f35c665e74e327b8b931592fbcaed32c2;hb=HEAD#l139
[2] 
https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=m4/locale-tr.m4;h=4b99e67d1d306d5243527364046b4f5501476367;hb=HEAD#l9
[3] 
https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=blob;f=gettext-tools/m4/locale-de.m4;h=b252a25ece9bf5245ff7ed1725a4fc733af55c07;hb=HEAD#l9






reply via email to

[Prev in Thread] Current Thread [Next in Thread]