Anas
Anas

Reputation: 13

Adding support for gb2312 and shift-jis to newlib iconv

I have a requirement to convert UCS2 to following code pages

  1.   Chinese: gb2312
    
  2.   Japanese: shift_jis
    
  3.   Russian : cp1251
    
  4.   Hungrian, Polish and Cesky: cp1252
    
  5.   Default: cp1250
    

I could see that items 3-5 are supported in newlib iconv library.

For gb2312 or gbk I could see that it's supported in Cygwin-windows only. Is there a feasibility issue to support gb2312 for embedded cortex M controllers?

I can see Jis implementation in newlib and but is not available for Cygwin.Is It available for embedded cortex M controllers?

What is the difference between jis and shift-jis, is it compatible with euc_jp

I have tried cp1250,cp1251 and cp1252 successfully but not able to figure out a path for gb2312 and shift_jis

Upvotes: 0

Views: 154

Answers (1)

Anas
Anas

Reputation: 13

I have partially able to do for shift_jis by creating tables using

 1. wget ftp://sourceware.org/pub/newlib/newlib-4.2.0.20211231.tar.gz
 2. tar -xvf newlib-4.2.0.20211231.tar.gz
 3. cd newlib/libc/iconv/ccs/

 4. wget https://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/JIS/SHIFTJIS.TXT
 5. ./mktbl.pl  -S SHIFTJIS.TXT 
 6. cd ../ces/
 
 7. ./mkdeps.pl

Upvotes: 0

Related Questions