Read Cyrillic text from a file

Sep 13, 2016
50
0
Hi from Belarus!
I installed Russian version of Windows 10 x64. OEM code page - 866.
When writing text in Russian with the help of a file >>! This text is written correctly, ie it can be read with any text editor, for example, FAR Manager.
But when reading it line by line using the "%@line" on the screen is given unreadable text.
Is there any way to solve this problem?
TCC version 20
 
Aug 3, 2016
376
9
Netherlands
It's a little hard to reproduce (I think) here on an Eglish Windows version, but isn't this about the FONT you are using in TCC?
(Alt-spacebar > Properties (which will be called somthing else on a Russian Windows version, I guess...) > Tab Fonts to change it for the current session; "Defaults" to change it for well .. default :-)
 

rconn

Administrator
Staff member
May 14, 2008
12,344
149
Remember that Windows GUI apps and Windows console apps use different codepages & fonts, so you need to make sure you've got the same settings in both environments.

If the file is Unicode UTF-16 and you have the correct font selected for the console session, you shouldn't have any issues. If the file is non-UTF16 (i.e., UTF-8 or 8-bit extended ASCII) then it gets much more problematic for TCC to identify.

If you think you have everything configured correctly and still can't display the file correctly, please post an example file here for us to test.
 
Aug 3, 2016
376
9
Netherlands
Oh, I read your post wrong: you are using Windows 10 (somehow I managed to read Windows XP...).

Behaviour of "Properties" has changed between WinXP and Win7/10:
From Win7 on, if you change settings under "Properties", they will be put in the shortcut you used to start the program with.
So in your case (Win10): these settings will be saved.
Sorry for any confusion....
 
Sep 13, 2016
50
0
Oh, I read your post wrong: you are using Windows 10 (somehow I managed to read Windows XP...).

Behaviour of "Properties" has changed between WinXP and Win7/10:
From Win7 on, if you change settings under "Properties", they will be put in the shortcut you used to start the program with.
So in your case (Win10): these settings will be saved.
Sorry for any confusion....

Ok, Thanks Yoy! But the problem is not solved.
 
Sep 13, 2016
50
0
Remember that Windows GUI apps and Windows console apps use different codepages & fonts, so you need to make sure you've got the same settings in both environments.

If the file is Unicode UTF-16 and you have the correct font selected for the console session, you shouldn't have any issues. If the file is non-UTF16 (i.e., UTF-8 or 8-bit extended ASCII) then it gets much more problematic for TCC to identify.

If you think you have everything configured correctly and still can't display the file correctly, please post an example file here for us to test.

The program is written in coding 866. All messages are displayed on the screen is correct, except for reading lines from a file. Here is an example.

echo off
echo.
echo Проверка > test.txt
echo check >>! test.txt
echo %@line[test.txt,0]
echo %@line[test.txt,1]
pause

The first line is displayed as unreadable text. The second - is correct.
Option, which has offered of MaartenG, brought no result.
I tried the code page 65001 and others, but the problem remained.
If the text is displayed with using an "echo" or a "scrput" or "screen" text is visible correctly.

With Far manager editor created a file encoded in 1200. The lines of this file is read correctly. But! When you try to change the code page 1200 (chcp 1200), the message "The specified code page is invalid".

In version 15, it works correctly in all systems - XP, 7, 8, 8.1, 10.

The problem comes in 16 and later versions.

p.s. Sorry for my English :-)
 

Attachments

  • test.btm
    132 bytes · Views: 81
Last edited:
Aug 3, 2016
376
9
Netherlands
p.s. Sorry for my English :-)

No problem at all! It was very easy to read (and must be 1000 times better than me trying to speak/understand Russian :-)

I tried your testscript and you are absolutely right. Same problem here.

I simplified your test even further and here are some results
(in Print-screen format, to prevent "translations" between my system and this forum)

Codepage = 866 and Console font = Lucida Console.

TCC 20 :

Capture1.JPG


In the 2. output you will notice there are only 7 characters. That is because %@char[160] is actualy the space-character. Just a coincidence


In TCC/LE 14 (the current version):

Capture2.JPG




But it's good to know my computer can speak Russian (never tried that one); now I can change my Matrix-script (somewhere else on this forum) to output Russian. Or Chinese ...
You learn every day on these forums :-)
 
Last edited:
Aug 3, 2016
376
9
Netherlands
That is really quick!

If this question can be answered simple and easy, I would like to know why there is a difference in results for different TCC versions on the same machine? Don't they call the same library?
Just curious...

("one fool can ask more questions than seven wise men can answer")
 
Last edited:

rconn

Administrator
Staff member
May 14, 2008
12,344
149
That is really quick!

If this question can be answered simple and easy, I would like to know why there is a difference in results for different TCC versions on the same machine? Don't they call the same library?

They call different versions of the same library. Microsoft changes it; sometimes they fix things, and sometimes they break things.
 
Similar threads
Thread starter Title Forum Replies Date
K "copy /z /w" command not deleting read-only files in destination Support 10
T unqlite binary read test is inconsistent Support 2
A TCC failing to read recursive symlinks Support 25
Alpengreis [Forum] Mark forumS (all!) read Support 2
D Custom ini-file is not read, by tcmd.exe cli Support 6
T read snmp values Support 4
C How to? Read Win7's Computer Libraries Support 19
T [TCC 18] Can't read nor write history Support 1
Charles Dye Read-only environment variables wiped by SETLOCAL / ENDLOCAL Support 5
MickeyF Trying to read XML Support 3
R attrib -C on a read only file? Support 1
samintz How to? read while ignoring whitespace Support 3
S WAD "Mark Forums Read" fails Support 4
vefatica Can DIRHISTORY read from clip:? Support 2
vefatica Mark a forum or thread as "read"? Support 5
M How to? How do I read a Unicode file through standard-input? Support 4
daniel347x How to get Take Command to read in all current system environment variables that CMD.EXE sees? Support 13
C Attaching PowerShell changes its colors and makes it hard to read Support 15
Dmitry L. Kobyakov Fixed The SETARRAY /R command works incorrectly with cyrillic files Support 2
Alexander How to? how can I use Cyrillic characters in the Echo command? Support 8
vefatica Tab (^t) in @FILEWRITE's text Support 0
R Bug TPIPE's pdf to text conversions don't work Support 2
Joe Caverly Using TYPE with non-English text Support 22
M Goto fails when a text endtext block precedes the code Support 5
Joe Caverly No blank line in TEXT...ENDTEXT in a LIBRARY function Support 8
S INPUT fails if the entered text contains pair of square brackets Support 6
Alpengreis List command: text truncated in find box (german) Support 9
vefatica Text invisible in v25 Support 10
S How to? What's the maximum size of the thread text ? Support 5
E Text copy bug Support 1
S FFIND text that includes " Support 7
S Setting Tabs=Bottom makes text turn black Support 6
Joe Caverly Multiple Text Searches at once using FFIND or TPIPE Support 4
AndrewJ TakeCommand v23 + ANSI color sequences leads to black on black text Support 6
D Grabbing html text with @line Support 3
M TCC screen text bright colors not as bright in 24 as 23 Support 5
vefatica Find Files/Text dialog: does it work? Support 0
Alpengreis Installer: text is still truncated in german language Support 2
Peter Murschall IDE destroys Text on Ctrl-U/Ctrl-Shift-U Support 12
Charles Dye OSD loses ampersands in text Support 2
R How to? Display text same as in CMD Support 14
Glenn Bowes Strange text at startup Support 5
M Fixed Cannot use the "Browse..." function in "Find files/text" dialogbox Support 2
Peter Murschall WAD FOR reads Text in ASCII !??!? Support 7
B Documentation Reference/Windows X64: Redundant text at the end Support 0
Joe Caverly LIST /T (search for Text) Support 2
nikbackm How to? Find duplicate lines in text file Support 0
J Input text converts to uppercase Support 1
T How to? Select and Delete text Support 6
vhodro How to? Select text Support 10

Similar threads