Ren Jeffrey: > I have checked Scintilla Asian string display question in Windows 9x > English. > Here is the solution, but there are still some questions. > ... > // You should get the codepage from Scintilla Window > int CodePage = 936; // Chinese codepage > > wchar_t tbuf[MAX_US_LEN]; > int wStrSize=MultiByteToWideChar(CodePage, 0, s, -1, NULL, 0); > MultiByteToWideChar(CodePage, 0, s, -1, tbuf, wStrSize);
In current Scintilla, the character set determines the font and thus the visual representation of the bytes being drawn. The character set can be different for each style. My main use for this feature was to use Japanese fonts only for text that could be Japanese while drawing styles that were always ASCII text (such as keywords) using a better looking latin-only font. SciTE only allows one character set at a time but other editors may, for example, have displayed different 8 bit character sets (such as 8859-1 and KOI-8) within one document. If anyone is using this feature, you'd better speak up or it may disappear. I'd like to know if there is any performance impact from the two MultiByteToWideChar calls. On Unicode based versions it shouldn't be noticeable (although the OS is supposed to be a little clever here) but on Windows 9x these strings will often have to be converted straight back to 8 bit strings. European language Windows 9x users may not like paying a performance price for a feature that doesn't benefit them and people using 9x are often on older slower machines. > The original ExtTextOutA and DrawTextA cannot display the Asian string in > English 9x OS. I'm wondering if you have the language support packs that were produced for Internet Explorer or Office installed? My recollection was that that was one of the things you had to do to work with Japanese on Windows 95. > 1. The cursor move is incorrect, sometimes jump two Chinese words (four > bytes); > 2. The text cannot be selected. > 3. When selecting, the string will be refreshed and changed. This is under the control of Platform::DBCSCharLength, which calls IsDBCSLeadByteEx so possibly needs a different call. > 4. What's the function of ListBoxX::Draw? > The "DrawText" should be changed to "ExtTextOut" or "TextOut". > "DrawTextW" cannot work in 9x. This draws each item in an autocompletion list. I'm not sure why DrawText was used in the autocompletion boxes. They should change to ExtTextOut. > 5. How to get the codepage in SurfaceImpl class? During set up of a surface, SetDBCSMode is called with the code page. As code page is not used in existing Surface code, it is ignored. If it is needed then it could be stored as a member of SurfaceImpl. > BTW: Can this mail list post the attachment? Files smaller than 30K are OK. > If possible, I may post the updated PlatWin.cxx file. Put it on a web site or create a bug on the SourceForge tracker and attach the file. Neil _______________________________________________ Scintilla-interest mailing list [email protected] http://mailman.lyra.org/mailman/listinfo/scintilla-interest
