Problem with CP932 + charset Shift-JIS (Windows)

53 views
Skip to first unread message

Bengt V

unread,
Jan 23, 2012, 3:24:59 PM1/23/12
to scintilla-interest
Windows only! (probably)

When opening a file encoded with CP932 in Scintilla, and choosing
codepage=932
and charset=Shift-JIS, japanese characters are drawn just like
the garbage you get when using default codepage and charset.
However, when DirectX drawing is enabled,
SCI_SETTECHNOLOGY( SC_TECHNOLOGY_DIRECTWRITE ),
the japanese characters are drawn correctly.
UTF-8 works fine.
Have I missed something???

(Windows7 + Scintilla 3.0.2 + western locale ( =not japanese) )

All help is welcome!

Regards,
/Bengt

Bengt V

unread,
Jan 25, 2012, 5:48:09 AM1/25/12
to scintilla-interest
Update:
I can't seem to be able to reproduce this behavior using the
Scintilla example app "DMApp"...

So, all of a sudden help & hints became even more appreciated. ;)

Thanks in advance,

/Bengt

Bengt V

unread,
Jan 25, 2012, 4:41:36 AM1/25/12
to scintilla-interest
PS The main application is built as an "MBCS"-application (and not a
"UNICODE"-application ). That might be relevant...

/Bengt

Neil Hodgson

unread,
Jan 25, 2012, 7:33:05 PM1/25/12
to scintilla...@googlegroups.com
There is a problem with Google Groups where moderators no longer get
emails about pending messages so there will be delays in moderating
messages.

Bengt V:

> I can't seem to be able to reproduce this behavior using the
> Scintilla example app "DMApp"...
>
> So, all of a sudden help & hints became even more appreciated. ;)

Start copying calls from DMApp into your code until it works.

Neil

Bengt V

unread,
Jan 26, 2012, 7:37:53 AM1/26/12
to scintilla-interest
[PROBLEM SOLVED]
I think I've solved my problem. :)

Thanks Neil, but fortunately I'm blessed with a good debugger... ;)
By the way... How long are new group members considered "new"?

I got the first clue when stepping into the FontCached constructor,
and
saw that characterSet was 1 (instead of 128) for STYLE_DEFAULT.
Since I only changed charset for 0-31 (which includes the c-comment
style,
and the japanese text was in a comment) this was left unchanged.

After setting a font, only for STYLE_DEFAULT, I never called
SCI_STYLECLEARALL. (Ooops) ;)
So the default font's charset contaminated the actual text drawing.

Sorry I wasn't able to locate this problem before posting.

/Bengt
Reply all
Reply to author
Forward
0 new messages