|
Also.
This function not uses the EUC1, EUC2 for check of ch1 and ch2 Is it right? Also #3 :)
This common problem(?) at CVBIG5_big5_to_unicode CVGB_gb2312_to_unicode CVKSC_ksc_to_unicode CVJIS_eucj_to_unicode CVJIS_sjis_to_unicode functions: wide=(ch1<<8)+ch2; ucs2_ch=a1[a2[wide/256]+wide%256] --- I'm not sure that is correctly works at all platforms (big/little endian) ---- Similar situation with macros #define isodd(x) ((x)&1) Instead: (((x)%2)!=0) Also #4 [for cv_jis.cpp]
seven2eight has very strange (from India?) code if(isodd(*p1)) {...} else if(!isodd(*p1)) {...} EUC1, EUC2 is not used but direct checking (& 0x80) is present.
Your worries about endian seems not correct. We use machine endian intermediary unicode. (x & 1) vs (x % 2 != 0) will work ok despite endian AFAIK. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
----
if (p_dest_ptr == NULL)
return (src_len);
----
Should be
if (p_dest_ptr == NULL)
return (sizeof(USHORT)*src_len);
???