Chapter 6. LOCALE technology
62
iconv_t conv = iconv_open(tocode, INTERNALCODE);
(conversion and writing...)
iconv_close(conv);
} else {
(original writing routine)
}
Note that whole reading should be done at once since otherwise you may divide multibyte charac 
ter. You can consult the
iconv_prog.c
file in the distribution of GNU libc for usage of
iconv()
.
Though
nl_langinfo()
is a standard function of XPG5 and GNU libc supports it, it is not
very portable. And more, there are no standard for encoding names for
nl_langinfo()
and
iconv_open()
. If this is a problem, you can use Bruno Haible's libiconv (
http://www.gnu.
org/software/libiconv/
). It has
iconv()
,
iconv_open()
, and
iconv_close()
. And
more, it has
locale_charset()
, a replacement of
nl_langinfo(CODESET)
.
6.6 Limit of Locale technology
Locale model has a limit. That is, it cannot handle two locales at the same time. Especially, it
cannot handle relationship between two locales at all.
For example, EUC JP, ISO 2022 JP, and Shift JIS are popular encodings in Japan. EUC JP is the
de facto standard for UNIX systems, ISO 2022 JP is the standard for Internet, and Shift JIS is the
encoding for Windows and Macintosh. Thus, Japanese people have to handle texts with these
encodings. Text viewers such as
jless
and
lv
and editors such as
emacs
can automatically
understand the encoding to be read. You cannot write such a software using Locale technology.






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

indiana web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Inexpensive Web Hosting  Jsp Web Hosting

Cheapest Web Hosting Jsp Hosting Cheap Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved