VB6 text appears as gibberish in one EXE but Hebre

2019-07-30 20:04发布

问题:

I have strange problem and minimal knowledge on VB6,

I got an EXE file that takes text (for button captions) from a text file.
This EXE which I don't has it code present all Hebrew text correctly.

I have build another EXE file (Identical to the previous) and all the functionally is working but it present all Hebrew as Gibberish!!

my text file encoding is Unicode.

Can you help me? Is there encoding for vb6 exe?

回答1:

The default VB form/control fonts do not support all "foreign" characters.
If you set the font at runtime to "MS Shell Dlg" then Windows will translate this to the default UI font for that version of Windows which should handle most languages.

You'll also need to check the encoding of the file. If it's UTF-8 or a specific code page, then you'll need to use the MultibyteToWidechar() function to convert to UTF-16 for use in VB after reading it.



回答2:

the perfect solution to resolve this issue is to change the font.Charset to 177 that represent HEBREW_CHARSET.
For example:

Text1.Font.Charset = 177

http://www.example-code.com/vb/vb6-display-unicode.asp