user156144
user156144

Reputation: 2295

vbs: change codepage

I have vbs that I run on my desktop.

For some reason, Asc(Chr(148)) returns -32443 in JPN windows. I don't have this issue on ENG windows. I found similar issue posted here but it was for .net vb

Is there a way to change codepage of vbs? I tried chcp on the cmd window i run the script but it didn't do anything.

Thanks.

Upvotes: 2

Views: 6513

Answers (1)

Kul-Tigin
Kul-Tigin

Reputation: 16950

I think due to default locale id. Try to set the locale id.

'Test the default locale id

WScript.Echo GetLocale 'most likely prints 1041

'Set Locale id

SetLocale 1033 'en-US
WScript.Echo Asc(Chr(148))

Upvotes: 2

Related Questions