vbscriptwsh

How to display cyrillic text with the Popup method in VBS


I try to show cyrillic text before opening a HTA file through .VBS

CreateObject("Wscript.Shell").Popup "Пожалуйста подождите...", 1

But the text is displayed in incorrect encoding

How can I set the correct one?

ps. and how to add a new line like \n ?


Solution

  • Save the script in Unicode format (UTF-16 little endian) and the text should be displayed just fine.

    As for newlines, VBScript doesn't support escape sequences, but you can concatenate the constant vbNewLine to a string:

    Set sh = CreateObject("WScript.Shell")
    sh.Popup "Пожалуйста" & vbNewLine & "подождите...", 1