11.2. cn2jp - 在中文和日文間的編碼轉移函式庫

一個可以中文 {GB,Big5,HZ} 和日文 (EUC-Jis/Shift-Jis/Jis) 之間互相轉換的程式。

安裝 converters/cn2jp

基本的用法有:

% b2j < file.big5 > file.jis
% g2j < file.gb > file.jis
% j2b < file.jis > file.big5
% g2b < file.gb > file.big5
% j2g < file.jis > file.gb
% b2g < file.big5 > file.gb

另外還有幾個可以使用的 Library:

char    *lang_big5_to_eucjis(istr)
        ;translate Big5 in istr to EUC-Jis in allocated buffer
        ;the allocated buffer is returned and valid until next call
        ;refer to subdirectory big2jis

char    *lang_gb_to_eucjis();
        ;translate GB in istr to EUC-Jis in allocated buffer
        ;the allocated buffer is returned and valid until next call
        ;refer to subdirectory gb2jis

char    *lang_eucjis_to_big5(istr)
        ;translate EUC-Jis in istr to Big5 in allocated buffer
        ;the allocated buffer is returned and valid until next call
        ;refer to subdirectory jis2big

char    *lang_gb_to_big5(istr)
        ;translate GB in istr to Big5 in allocated buffer
        ;the allocated buffer is returned and valid until next call
        ;refer to subdirectory gb2big

char    *lang_eucjis_to_gb(istr)
        ;translate EUC-Jis in istr to GB in allocated buffer
        ;the allocated buffer is returned and valid until next call
        ;refer to subdirectory jis2gb

char    *lang_big5_to_gb(istr)
        ;translate Big5 in istr to GB in allocated buffer
        ;the allocated buffer is returned and valid until next call
        ;refer to subdirectory big2gb

int     lang_uzpj
        ;uses the uzpj system for unmappable words

int     lang_debug
        ;turns on the debug info in translation