Bugs item #1365392, was opened at 2005-11-24 01:06
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1365392&group_id=2439

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Scintilla
Group: Bug
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: Asian string display question in Win 9x English

Initial Comment:
Hi all,

Question: Asian string cannot be displayed normally in 
Win 9x English, even though you set the codepage and 
charset correctly. 
Scintilla version: v1.66.

Reproduce: 98SE English + IE6 SP1 update with CJK 
display and input support, then you can load a file 
with encoding Chinese/Japanese.
With the ANSI encoding file, SciTE cannot display the 
file content normally.
But with the UTF-8 encoding file, SciTE can display 
the file content normally.

My solution:
Scintilla Platwin.cxx file 
SurfaceImpl::DrawTextNoClip, DrawTextClipped, 
DrawTextTransparent functions uses ExtTextOut API.
If I convert the string from ANSI to Unicode then call 
ExtTextOutW, this question is cleared.

To avoid possible performance impact in NT/2K/XP and 8-
bit codepage file, the following method may be better.
if(IsNT() || nCodePage==0){
    ::ExtTextOut(hdc, rc.left, ybase, ETO_OPAQUE, 
&rcw, s,
        Platform::Minimum(len, maxLenText), NULL);
} else {
    // Support asian string display in 9x English
    wchar_t tbuf[MAX_US_LEN];
    int wStrSize=MultiByteToWideChar(nCodePage, 0, s, -
1, NULL, 0);
    MultiByteToWideChar(nCodePage, 0, s, -1, tbuf, 
wStrSize);
    
    ::ExtTextOutW(hdc, rc.left, ybase, ETO_OPAQUE, 
&rcw, tbuf,
        wStrSize, NULL);
}

But this patch will bring other questions:
1. The cursor move is incorrect, sometimes jump two 
Chinese words (four bytes); 
2. The text cannot be selected except line EOL area;
3. When selecting, the string will be refreshed and 
changed.

The updated PlatWin.cxx file is attached.

Jeffrey Ren

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1365392&group_id=2439
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to