On March 24, 2007 at 10:26PM +0900,
tats (at vega.ocn.ne.jp) wrote:

> If so, I recommend:
>
> * Check a value of LC_ALL, LC_CTYPE, or LANG.
> * If the value is not UTF-8 locale, do setlocale(LC_ALL, "ja_JP.UTF-8").
> * if the return value of setlocale() is NULL, display a warning message.
>
> AFAICS, with LANG=ja_JP.eucJP LC_ALL=ja_JP.eucJP, if
> setlocale(LC_ALL, "ja_JP.UTF-8") fails, "ファイル"-"板一覧最読込"
> displays a bord list incompletely.  If setlocale(LC_ALL,
> "ja_JP.UTF-8") succeeds, it works correctly.  With LANG=en_US.UTF-8
> LC_ALL=en_US.UTF-8 without setlocale(), jd seems to work.

I reconsidered that setlocale() should be done to set locale
categories, so I've revised my suggestion:

* Do setlocale(LC_ALL, "").
* Check a value of setlocale(LC_CTYPE, NULL).
* If the value is not UTF-8 locale, do setlocale(LC_ALL, "ja_JP.UTF-8").
* if the return value of setlocale() is NULL, display a warning message.

--
Tatsuya Kinoshita

Attachment: pgpXz9YNGh6eZ.pgp
Description: PGP signature

Reply via email to