Moved this from our bugzilla item 1703
to here: The suggested patch might be
useful as workaround, but it breaks the
compatibility with other languages. It
would be better to have real DBCS (double
byte char support) in FreeDOS, maybe as
a compile time option. Note that you will
still need a Chinese font system and a
suitable keyboard driver / Input Method.
The font system will typically run in
graphics mode as the VGA hardware can
only have fonts of max 512 different
chars of 9x32 pixels each.
The official DBCS interface works as follows:
Int 21 function 6300 and the COUNTRY system
(int 21.65nn and optionally NLSFUNC) manage
a list of "lead bytes" (quma, I assume) and
then internally (alledgedly) do something
similar to what Li Jian suggests: Do special
backspace processing where lead bytes are
involved and avoid upper/lower case changes
for bytes which are part of Chinese chars...
Are those assumptions correct? Please comment!
I'm a programmer from China. My name is Li Jian.
About three months ago, I made a project called FCDOS (Free Chinese DOS). Now, it has some basic functions: display the Cinese chars, IMEs, etc.
In the MS-DOS, FCDOS runs OK. But in Freedos, there are some problems. First, let me introduce some knowledge of the Chinese char. The Chinese char has two
bytes, the first byte(called "quma") from 0xa1 to 0xf7, the second byte (called "weima") from 0xa1 to 0xfe. So, there are two problems as the follows:
1. When the key of LEFT, CTL_BS or BS has pressed,and there have the Chinese char, we should backspace twices ,not just once. So I resolve this simply just as follows:
/* -- Line 273 -- */
#define ishz(c) ((unsigned char)(c) > 0xa0)
/* -- Line 467 -- */
if(ishz(c2) && (count > 0))
if (stored_pos > 0) stored_pos--;
2. The filename that has Chinese chars cannot be correctly used. This is because the filename has being upcased, so the Chinese char has being destroyed. I resolve this simply just as follows:
/* -- Line 283 -- */
if ((c = *str) >= 'a' && c <= 'z')
*str += 'A' - 'a';
else if ((c > 0x7f) && (c < 0xa1))
*str = map[c];