Re: [patch] forward port of 16 bit nls (vfat, ntfs, ncpfs,

From: Petr Vandrovec (VANDROVE@vc.cvut.cz)
Date: Mon Jul 03 2000 - 23:04:27 EST


On 3 Jul 00 at 22:55, Urban Widmark wrote:
> > Also, it looks to me like that 16bit codepages (cp932/936/949/950) use
> > '?' (0x3F) for unknown character instead of returning an error code...
> > As you cannot convert '?' back to real value, user should be at least
> > warned, I think...
>
> In 2.2 yes, but the 2.4 version of uni2char may return -1, as well as set
> the output to ?. char2uni should perhaps also return a status code, but
> that is unable to fail (at least for all charsets currently available).

For example uni2char() of cp950 will translate 0xFFFF to two '?' and will
return 0, because of unused fields in u2c_FF[] are filled with 0x3F...
or are not they? And char2uni() will silently convert 0xF9,0x01 to
{ 0x00, 0x3F }.

BTW, these tables do not follow uni1 = low, uni2 = high byte, as nicely
shown in cp950's char2uni():

  *uni1 = charset2uni[cl].uni2;
  *uni2 = charset2uni[cl].uni1;
  
Maybe you should pass these tables through some filter to byteswap
them? Or convert uni1/uni2 to simple unsigned short? As compiled
nls modules are not portable from one architecture to another, byteordering
should not matter...
                                            Best regards,
                                                        Petr Vandrovec
                                                        vandrove@vc.cvut.cz
                                                        
                                                        
P.S.: Thanks for UTF8 table.
                            

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jul 07 2000 - 21:00:14 EST