How to properly run non English scripts in English Windows?

8 views
Skip to first unread message

JJ

unread,
Feb 18, 2020, 10:53:19 PM2/18/20
to
For example, below simple code displays some Cyrillic characters, but was
encoded using ANSI encoding with Cyrillic code page 1251.

wscript.echo "БГДЖЗИЙ"

The file's binary data:

77 73 63 72 69 70 74 2E 65 63 68 6F 20 22
C1 C3 C4 C6 C7 C8 C9
22 0D 0A

In English Windows' Notepad, the code shows as:

wscript.echo "ÁÃÄÆÇÈÉ"

When run with CSCRIPT from the command prompt, it'll displays the incorrect
characters:

ÁÃÄÆÇÈÉ

I've tried switching to code page 1251 using the CHCP command like below,
but the result is the same.

chcp 1251

I've also tried using CSCRIPT's undocumented //CP switch like below, but
still same result.

cscript //cp:1251 test.vbs

I've also tried other Cyrillic code pages 21866 and 866, but same thing.

So, how to properly run the script so that it'll display the correct
Cyrillic characters? _Without_ changing the script file encoding to UTF16,
or modifying it in any way.
Reply all
Reply to author
Forward
0 new messages