Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Fixed TCC identify Chinese problems

Dec
20
0
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!
 
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.
 
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:
tcc1.png
 
Last edited:
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]
 
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.
 
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
 
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:
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:
??????
 
dir command can not alignment on the Chinese filename than English filename.


tcc2.png




tcc3.png




tcmd1.png
 
Last edited:
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
 
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.
 
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
 
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:
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
 
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!
 
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
 
TCC 20.11.38 has completely fixed this problem. TCC perfect support for Chinese!
Now only Take Command does not support Chinese.
 
Back
Top
[FOX] Ultimate Translator
Translate