Character encoding in vb6

I have an application that stores txt, word and pdf files. It then displays the document to the user when the View option is selected.

We use the following code to convert a Unicode string to an array of bytes.

   aANSISString = StrConv(VerToInsert.FileBuffer, vbFromUnicode)

The document is viewed by the default application for this type of document. Such as Microsoft Word for .doc files and so on. The problem that I am encountering is when the system locale is changed to “Non-English,” for example, in Arabic (page code 1256), the data is corrupted and cannot be viewed. But as soon as the language standard of the system changes to English, everything works fine.

I do not encounter this problem with txt files. Can someone tell me the reason or give me a link to the page.

+3
source share
1 answer

Adding to the comment Bob77 - From the documentation of the Office Center Center about the third parameter LCID ( https://msdn.microsoft.com/en-us/library/office/gg264628.aspx ):

LCID - Optional. LocaleID if it is different from the system LocaleID. (The LocaleID system is the default.)

StrConv is locale dependent unless you specify an LCID.

You should always provide an LCID if your users have a different language than English.

0
source

All Articles