DBCS Enabling
To write double-byte character set (DBCS) enabled code
-
Avoid assuming:
-
fixed character size
-
fixed lead byte range
-
Use CharPrev and CharNext instead of p-- or p++
-
Treat lead bytes and trail bytes as one unit
-
Handle WM_IME_CHAR
-
Store code page information with data
-
Check your algorithms for:
-
caret positioning
-
pointer arithmetic
-
character code alignment
-
word wrapping