Index: wv.h =================================================================== RCS file: /cvsroot/wv/wv.h,v retrieving revision 1.70 diff -u -r1.70 wv.h --- wv.h 2000/11/14 20:46:26 1.70 +++ wv.h 2000/11/19 03:34:58 @@ -3194,6 +3194,7 @@ typedef size_t (*wvConvertToUnicode)(const char **, size_t *, char **, size_t *); char *wvLIDToCodePageConverter(U16 lid); +U16 wvnLocaleToLIDConverter(U8 nLocale); typedef struct _MSOFBH { Index: text.c =================================================================== RCS file: /cvsroot/wv/text.c,v retrieving revision 1.58 diff -u -r1.58 text.c --- text.c 2000/11/18 07:19:49 1.58 +++ text.c 2000/11/19 03:34:58 @@ -21,11 +21,27 @@ int wvOutputTextChar(U16 eachchar,U8 chartype,wvParseStruct *ps, CHP *achp) { - U16 lid; + U16 lid = 0; + version v; + + v = wvQuerySupported(&ps->fib, NULL); + /* testing adding a language */ - lid = achp->lidDefault; + + /* For version <= WORD7, The charset used could + * depend on the font's charset. + */ + if((v <= WORD7) && (!ps->fib.fFarEast)) + { + FFN currentfont; + currentfont = ps->fonts.ffn[achp->ftc]; + /* Return 0 if no match */ + lid = wvnLocaleToLIDConverter(currentfont.chs); + } + if(!lid) + lid = achp->lidDefault; + /* No lidDefault for ver < WORD6 */ - /* Should try achp->lid first? */ if (lid == 0x400 || lid == 0) lid = ps->fib.lid; @@ -46,7 +62,6 @@ /* Most Chars go through this baby */ if (charhandler) { - version v = wvQuerySupported(&ps->fib, NULL); if(!((v == WORD7 || v == WORD6) && ps->fib.fFarEast)) if (v <= WORD7) { @@ -191,6 +206,22 @@ }; return("CP1252"); } + +U16 wvnLocaleToLIDConverter(U8 nLocale) +{ + switch(nLocale) + { + case 134: /* Chinese Simplified */ + return (0x804); + case 136: /* Chinese Traditional */ + return (0x404); + + /* Add Japanese, Korean and whatever nLocale you see fit. */ + default: + return (0x0); + } + return (0x0); +} static U32 swap_iconv(U16 lid)