Porting to OS/2: Case #27 iconv() and configure test
iconv() is used to support i18n(internationalization). On OS/2, there are ULS(Universal Language Support) APIs. kLIBC provides iconv() implemented by this ULS APIs.
By the way, ULS APIs are dependent on the installed code page files in \LANGUAGE\CODEPAGE on a boot drive. Unfortunately, SBCS OS/2 does not have some DBCS code page files by default.
As a result, some DBCS charsets are not supported by ULS APIs on SBCS system. Likewise iconv() of kLIBC fails to support DBCS charsets.
Especially, configure test for iconv()(iconv.m4) checks the eucJP charset which corresonds to IBM-954 code page(See \LANGUAGE\CODEPAGE\UCSTBL.LST). However, SBCS OS/2 does not have IBM-954 code page file in \LANGUAGE\CODEPAGE by default. After all, configure test for working iconv() fails.
There are three ways to solve this problem.
1. Copying IBM943 to IBM954
IBM943 is a Japanese code page file. So copy it to IBM954. This is very simple workaround to pass configure test. But IBM943 is not same as IBM954. If some program try to use IBM954(eucJP) actually not to test, it will get wrong results.
2. Installing code page files
eCS v2.1GA and Arca OS v5.0 have code page files for DBCS system, but they do not install those code pages by default.
Those code page files are in \OS2IMAGE\FI\FONT. They are .zip files. All you have to do is just unzipping them into \LANGUEAGE\CODEPAGE.
There are 4 .zip files.
I recommend to install all of those 4 files.
In \OS2IMAGE\FI\FONT, you will also find fonts for DBCS systems. If you need DBCS fonts, install those files. To ease this process, there are .cmd files. Use them.
You will find those code page files and font files in other versions of OS/2 installation CDs, too.
3. Using GNU libiconv
GNU libiconv has no this problem. Using it solves all problems of iconv() of kLIBC caused by limitaitons of ULS APIs. For deatils, see <Porting to OS/2: Case #13 iconv()>.
4. Conclusion
We've found three ways. These will solve a configure test problem.
But the best way is to implement iconv() of kLIBC with GNU libiconv not OS/2 ULS APIs, or at least to install all code page files by default even if SBCS systems.
By the way, ULS APIs are dependent on the installed code page files in \LANGUAGE\CODEPAGE on a boot drive. Unfortunately, SBCS OS/2 does not have some DBCS code page files by default.
As a result, some DBCS charsets are not supported by ULS APIs on SBCS system. Likewise iconv() of kLIBC fails to support DBCS charsets.
Especially, configure test for iconv()(iconv.m4) checks the eucJP charset which corresonds to IBM-954 code page(See \LANGUAGE\CODEPAGE\UCSTBL.LST). However, SBCS OS/2 does not have IBM-954 code page file in \LANGUAGE\CODEPAGE by default. After all, configure test for working iconv() fails.
There are three ways to solve this problem.
1. Copying IBM943 to IBM954
IBM943 is a Japanese code page file. So copy it to IBM954. This is very simple workaround to pass configure test. But IBM943 is not same as IBM954. If some program try to use IBM954(eucJP) actually not to test, it will get wrong results.
2. Installing code page files
eCS v2.1GA and Arca OS v5.0 have code page files for DBCS system, but they do not install those code pages by default.
Those code page files are in \OS2IMAGE\FI\FONT. They are .zip files. All you have to do is just unzipping them into \LANGUEAGE\CODEPAGE.
There are 4 .zip files.
- CXCODEPG.ZIP for Chinese(Simplified Chinese)
- JPCODEPG.ZIP for Japanese
- KOCODEPG.ZIP for Korean
- TWCODEPG.ZIP for Taiwanese(Traditional Chinese)
I recommend to install all of those 4 files.
In \OS2IMAGE\FI\FONT, you will also find fonts for DBCS systems. If you need DBCS fonts, install those files. To ease this process, there are .cmd files. Use them.
You will find those code page files and font files in other versions of OS/2 installation CDs, too.
3. Using GNU libiconv
GNU libiconv has no this problem. Using it solves all problems of iconv() of kLIBC caused by limitaitons of ULS APIs. For deatils, see <Porting to OS/2: Case #13 iconv()>.
4. Conclusion
We've found three ways. These will solve a configure test problem.
But the best way is to implement iconv() of kLIBC with GNU libiconv not OS/2 ULS APIs, or at least to install all code page files by default even if SBCS systems.
댓글
댓글 쓰기