On Tue, May 01, 2001 at 01:01:25PM +0800, zhaoway wrote: > Hi, > > i'm writing dim. i have a question: if i should store chinese > charaters into db file using wcs (internal encoding used by glibc, > which is ucs-32 by now) or should i convert them into locale dependent > mbs (gb2312, big5, utf-8 etc). and why? the db file i'm using is > created by libdb2 (/ libdb3) which is itself a binary file. > > thanks in advance!
I think the Chinese phrases in the db are highly locale-dependent anyway (eg. many phrases are different in mainland compared to Hong Kong), so storing them using the local encoding (GB2312, Big5...) should not be too much of a problem. On the other hand, the encoding used in an area can change over time (eg. GB2312 -> GBK), and so you'll need to convert whatever in the db to the user's locale anyway (at runtime maybe?), so you might as well use UCS-4. BTW will dim only be compiled with glibc 2.2? Because it is not guaranteed that wcs is UCS-4 elsewhere ... -- Roger So Opinions are mine, Sun Wah Linux Ltd. not my employer's.

