Fixed TCC identify Chinese problems

Dec 21, 2016
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!
 

rconn

Administrator
Staff member
May 14, 2008
12,404
152
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
20
0
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
20
0
tcc1.png
 
Last edited:
Dec 21, 2016
20
0
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
12,404
152
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
20
0
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
20
0
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
20
0
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
20
0
dir command can not alignment on the Chinese filename than English filename.


tcc2.png




tcc3.png




tcmd1.png
 
Last edited:
Dec 21, 2016
20
0
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
12,404
152
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
20
0
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
20
0
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

  • StoryChinese.zip
    117.6 KB · Views: 84
Last edited:
Dec 21, 2016
20
0
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
20
0
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
20
0
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
 
Dec 21, 2016
20
0
TCC 20.11.38 has completely fixed this problem. TCC perfect support for Chinese!
Now only Take Command does not support Chinese.
 
Similar threads
Thread starter Title Forum Replies Date
M How to? Identify 64-bit and 32-bit TCC sessions... Support 7
A Can you set an image file 'tag' with TCC/4NT? Support 2
P PSHELL not working in TCC 26 Support 9
vefatica SCRIPT makes TCC disappear. Support 16
MickeyF TCC suddenly crashing (not TCC's fault) Support 2
Z CMDDebug - TCC unknown command Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT 28.02.17 Support 0
vefatica TCC startup: /IP not honored after /K Support 1
MickeyF TCC crashing when copying multiple files (now resolved) Support 6
C COMSPEC constantly reset to TCC.EXE Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT v28 Released Support 0
C How to? starting TCC/TCMD v25 Support 2
CWBillow TCC and TCMD in Powershell Support 6
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.24 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.01.23 uploaded Support 0
Alpengreis Fixed Crash after copy dialog with big TCC.exception.log Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT v27.01 Build 22 Uploaded Support 0
L FTYPE in TCC, less quirky than in cmd.exe Support 3
V Set path permanently from within TCC? Support 3
DrusTheAxe Runaway TCC.exception.log filling drive Support 5
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.21 uploaded Support 0
Joe Caverly tcc.exception.log Support 3
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.20 uploaded Support 0
rconn News Take Command / TCC / CMDebug / TCC-RT 27.0.19 Support 0
FreezerBurnt Help making a CMD and TCC compatible batch file Support 7
vefatica SCRIPT ... TCC disappears Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT v27.0.18 Support 0
Jesse Heines Access Denied errors in TCC 27 Support 9
fpefpe How to? tcc inifile (%_ininame) Support 3
M How to? Black TCC Prompt Support 2
D Differences between TCC and CMD with COPY /b Support 4
M Oracle batch OPatch.bat.bat not working in TCC but correctly in CMD Support 5
Jay Sage Extra TCC Tasks Support 6
vefatica Can I turn off the minimize to tray mechanism in TCC? Support 5
N Command execution slows down in TCC Prompt after a while Support 6
R Upgrade TCMD 19 to TCC 26 Support 1
Joe Caverly Set a batch variable (%1 - %n) when TCC is executing a batch file Support 5
samintz How to? Is this doable in TCC? Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT 26.02.41 Uploaded Support 0
D TCC tab detaching & restarting Support 3
Ó Recent git output not shown on TCC Support 1
P Kill all other instances of tcc from a btm batch file Support 2
L Using TCC.exe through an SSH connection Support 3
M TCC color issue in ConEmu Support 4
Alpengreis UTF-8 problem in TCC related to Python Support 7
Alpengreis Python support for 3.8.3 in TCC v26.x? Support 2
rconn News Take Command / TCC / CMDebug / TCC-RT 26.01.40 uploaded Support 0
Peter Murschall TCC V26.01.3x Debugging has problems with Alias /R Support 1
rconn News Take Command / TCC / CMDebug / TCC-RT 26.0.37 Uploaded Support 0
vefatica TCC waits for Office apps Support 4

Similar threads