Welcome!

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

SignUp Now!

Using TYPE with non-English text

Aug
1,927
70
Code:
     _x64: 1
   _admin: 1
_elevated: 1

TCC  27.00.18 x64   Windows 10 [Version 10.0.19042.746]

In the clipboard, I have an Arabic word.

TYPE does not return the proper characters, but @LINE does.
1610981622668.png


Why the difference?

Joe
 
The contents of the clipboard. Which I guess means, "How are you putting this text on the clipboard?"
 
Google Translate
1611067048499.png

I click on the lower-right icon to copy to the clipboard.

Joe
 
The text snippet isn't long enough for TYPE to determine whether it's ASCII, UTF8, or UTF16. (And it doesn't have a BOM to help.)
How do @clip[0] and @line[clip:,0] manage to get it right?
 
The text snippet isn't long enough for TYPE to determine whether it's ASCII, UTF8, or UTF16. (And it doesn't have a BOM to help.)

Is TYPE reading from the clipboard directly? Or is it copying the data out to a file, and then dumping that?
 
Hmmm! In Windows Terminal I see a rendering of it that looks more like Google's (than TCMD's rendering; consoles just give the unprintable symbol). Why does TCMD show it differently? And I'd like to know how WT/TCCTCMD/ConHost (???) knows it's right-to-left text. In the third line below, I pasted it on the command line and pressed backspace once; the cursor was at the righthand end but the leftmost character was deleted.

1611074580850.png
 
Here they are, side by side, Windows Terminal on the left, TCMD on the right, pasted from the same clipboard, same font (Consolas). Why do they look different? And when I look at Consolas with CharMap, I don't see ANY Arabic characters.

1611075889916.png
 
Hmmm! In Windows Terminal I see a rendering of it that looks more like Google's (than TCMD's rendering; consoles just give the unprintable symbol). Why does TCMD show it differently? And I'd like to know how WT/TCCTCMD/ConHost (???) knows it's right-to-left text. In the third line below, I pasted it on the command line and pressed backspace once; the cursor was at the righthand end but the leftmost character was deleted.

View attachment 3246

Take Command and TCC do not support RTL character sets.
 
Here they are, side by side, Windows Terminal on the left, TCMD on the right, pasted from the same clipboard, same font (Consolas). Why do they look different? And when I look at Consolas with CharMap, I don't see ANY Arabic characters.

View attachment 3248
Hey @vefatica do you get the same results using the @UNICODE function on Windows Terminal as TCMD?

EDIT: Yep, same numbers as TCMD here on Windows Terminal;

1611082558268.png


Joe
 
VIEW works as it should with Arabic text in a file;
Code:
v.exe e:\utils\test.txt
1611190259309.png


This does not work;
Code:
e:\utils>echo %@line[test.txt,0]
مرحبا

...but this works;
Code:
e:\utils>echo %@line[test.txt,0] | *view

Why does echo @line work in my OP, that is, using the clip: as source, but echo @line does not work when the source is a text file?

Here's the hex VIEW for the file;
1611190853518.png


Yet, echo @line works when piped through to VIEW.

Not sure why I did not have problems a few years back when working with Hebrew characters, but Arabic is not playing nice.

Joe
 
My psychic powers tell me that TEST.TXT is UTF-8 with no BOM, and OPTION UTF8 returns a No.
 
My psychic powers tell me that TEST.TXT is UTF-8 with no BOM, and OPTION UTF8 returns a No.
Well, psychic one, you are correct!

I've enabled Unicode output and UTF8, and it seems to be working now.
1611197675960.png

This works now;
1611197761617.png


Thanks @Charles Dye

Joe
 

Similar threads

Back
Top