Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: UTF-8 fonts



On Wed, Sep 25, 2002, Peter Stephenson wrote about "Re: UTF-8 fonts":
> > > - determining whether the terminal is actually in UTF-8 mode, probably
> > >   from the locale
> > 
> > Impossible. Local names are just arbitrary chosen strings; there is no
> > "character set code" defined in any locale definition, at least on Unix.
> 
> Read the document at the link I gave which suggests otherwise.  However,
> I now think we can in any case leave this to the mb* suite to decide.

Here's a piece of code I used in one of my programs to tell whether the
user's terminal is in utf8 mode, based on the locale:

        setlocale(LC_CTYPE, "");
        is_utf8= !strcmp(nl_langinfo(CODESET),"UTF-8");


-- 
Nadav Har'El                        |   Wednesday, Sep 25 2002, 19 Tishri 5763
nyh@xxxxxxxxxxxxxxxxxxx             |-----------------------------------------
Phone: +972-53-245868, ICQ 13349191 |For people who like peace and quiet - a
http://nadav.harel.org.il           |phoneless cord.



Messages sorted by: Reverse Date, Date, Thread, Author