[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-gnu-libiconv] Re: Creating Locale [Help Needed]
From: |
Bruno Haible |
Subject: |
[bug-gnu-libiconv] Re: Creating Locale [Help Needed] |
Date: |
Thu, 6 Nov 2008 14:45:46 +0100 |
User-agent: |
KMail/1.9.1 |
Abhirav Kushwaha wrote:
> I need to convert a Japanese file to UTF-8 that is encoded in
> 'iso-2022-jp'(JIS) format but my environment does not have the locale for
> JIS. So, I cannot use 'iconv' to convert the file.
Note that when people say that a file is in ISO-2022-JP, most often they
mean ISO-2022-JP-2 (because ISO-2022-JP is not usable for Japanese: it
does not even contain the Katakana and Hiragana characters).
Also note that 'iconv' has command-line options for controlling conversion
problems. Option -c discards unconvertible characters, and GNU libiconv's
iconv program also has options --unicode-subst and --byte-subst that allow
to write the unconvertible characters in a failsafe form.
> I would be very greateful if you could just guide me where can I find the
> JIS charmap, 'Japanese locale source for JIS' and 'JIS to Unicode' mapping
> file so that I can use localedef to create locale and then use iconv to
> convert the file to UTF-8.
>
> I searched a lot on internet but could not get the right information about
> how to create locale.
There are no locales in ISO-2022-* encodings, because these encodings are
stateful. The closest you can get is a terminal emulator (like 'xterm'
with 'luit') that accepts ISO-2022-JP-2 encoded input and converts it on
the fly to EUC-JP or UTF-8. But that's only a makeshift. Your best choice
is UTF-8 all the way.
Bruno
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug-gnu-libiconv] Re: Creating Locale [Help Needed],
Bruno Haible <=