• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed TCC identify Chinese problems

Dec 21, 2016
18
0
#1
My OS is Chinese Windows7.
Typically, a Chinese character display to take up the width of two English letters.

example:
char: 中国人
width: 123456

However, TCC does not handle this correctly. The most obvious is in the command line, if you enter some Chinese, the cursor can not correctly locate.

example:
C: \> dir 中国人.doc

When the input of this command, the cursor stays in the "d" position, even if you press the key "End", is the same. I think this is the command line, there are 3 Chinese, the display takes up the width of 6 English characters, but TCC only calculated the width of their 3 English characters. So the cursor position is wrong. The same problem also exists in "dir, list ..." and other commands related to the display output.

It is for this reason, so chinese users can not use the normal TCC, it is estimated that other users, such as Japanese, Korean is so problematic. Very much hope Rex Conn can solve this problem, very grateful!
 

rconn

Administrator
Staff member
May 14, 2008
10,315
93
#4
Is this in a stand-alone TCC console window, or in a TCMD tab window?

In a console window, TCC does not control the cursor position (unless you use one of the editing keys); that's done by Windows itself. In a TCMD tab window, TCMD queries the (hidden) console for its current cursor position and uses that.
 
Dec 21, 2016
18
0
#5
This is in the TCC console window. TCMD tab windows are more incompatible with this can not enter the Chinese, display output is also half of the incomplete Chinese characters, so I never use it.

You are right, I did not say clearly. In the TCC console window, enter the Chinese will have some display problems, enter a Chinese character, the cursor will only move a letter position, the correct should be 2 letters. Therefore, the previous Chinese characters can not display properly, only the last Chinese characters can be displayed. Therefore, after I enter the command, press the Up key again, so that Chinese characters fully displayed. The cursor is positioned incorrectly.
 
Last edited:
Dec 21, 2016
18
0
#9
I tried to set the TCMD.INI directive "CharWidth = 2" (in the [4NT] section), but it was not used.

These Chinese characters are GBK encoding (CodePage 936), GBK is double-byte representation, the overall coding range of 0x8140-0xFEFE, the first byte between the 0x81-0xFE, the second byte between the 0x40-0xFE(excluding 0x7F).

For more information, see: [title]
 

rconn

Administrator
Staff member
May 14, 2008
10,315
93
#12
Then I cannot reproduce your problem -- the test build works for all double-width characters that I tried.

You can use the "ReadConsole=Yes" directive in your TCMD.INI file ([4NT] section); that will tell TCC to use the Windows line input (ReadConsole) API for all input, instead of the character input that TCC normally uses. Using ReadConsole means you'll be limited to CMD.EXE-compatible line input features; i.e. none of the TCC editing, tab completion, or cut & paste.
 
Dec 21, 2016
18
0
#13
I tried the "ReadConsole=Yes", running TCC, kept on the output ^ C

[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
[C:\Program Files\JPSoft\TCMD20]^C
 
Dec 21, 2016
18
0
#14
You may be using the English version of windows, so can not reproduce my problem.

As long as the following settings, you can reproduce the problem in English windows 7:

1. Go to Control Panel -> Region and Language -> Change display language-> Administrative-> Language for non-Unicode programs-> Change system locale ..,
set Current system locale to "Chinese (Simplified, PRC), then restart Windows.

2.Run TCC. Paste "echo 中国人.doc" from here, then enter.
Or use notifications area, select the language CN and input method for input Chinese, you will be able to properly display the Chinese and found the problem.
 
Last edited:
Dec 21, 2016
18
0
#15
In addition, the list command can not support Chinese

Sample:

[C:\Program Files\JPSoft\TCMD20]type chinese.txt
中国人
[C:\Program Files\JPSoft\TCMD20]list chinese.txt
screen display:
??????
 
Dec 21, 2016
18
0
#19
Thank rconn reply.

CMD display normal. TCC / dir only in the calculation of the width of the Chinese characters out of the wrong(a Chinese characters as a letters), So it adds more tabs space to align, and therefore mistakes.


cmd1.png
 

rconn

Administrator
Staff member
May 14, 2008
10,315
93
#20
Everything is working for me in Windows 10. I tried a Windows 7 VM this morning, and I can now reproduce the problem you're seeing.

There are five documented APIs to return character widths in Windows; three fail with double-wide characters in Windows 10 and two work (one of which TCC 20.11 is using). In Windows 7, all five of the APIs fail. I'm going to have to experiment some more to find a kludge that will work in Win 7.
 
Dec 21, 2016
18
0
#22
I tried a TCC 20.11.33 in Chinese Windows 10 just, and I also can reproduce the problem.

The cause of the "Language for non-Unicode programs" setting ?



win10TCC1.png
 
Dec 21, 2016
18
0
#24
AWESOME! Finally fixed, the Chinese input work well !
"dir / w" OK.
Just "dir / x" there are some problems.
Take the liberty about, the way to "list" command also fix it?

tcc_ok1.png


list1.png
 

Attachments

Last edited:
Dec 21, 2016
18
0
#25
There is a small part of the Chinese characters can not normally identify the width.

such as:
Chinese Char: …‘’“”±×÷
Code: 0xA1AD 0xA1AE 0xA1AF 0xA1B0 0xA1B1 0xA1C0 0xA1C1 0xA1C2
 
Dec 21, 2016
18
0
#28
I'm just used to the "list", it is more like the original "more", only in the command line window, do not pop up a new window. Do not mind, forget it.
Since there is no DOS, short file names and "dir / x" is useless, I just report this problem.

Thank you rconn! Thank you for bringing great software!
 
Dec 21, 2016
18
0
#29
I tried the latest version of TCC 20.11.36, some Chinese characters still can not correctly identify the width. I have not tried all Chinese characters, , just to name a few.

Such as:
Chinese Char: ... '' "" ± × ÷
Code: 0xA1AD 0xA1AE 0xA1AF 0xA1B0 0xA1B1 0xA1C0 0xA1C1 0xA1C2
 
Top Bottom