Global Development and Computing Portal Global Development and Computing Portal

Ask Dr. International

Column #14

With the partying over (last month was my one year anniversary), I thought that I should get down and answer some of those excellent questions you have been asking. This column covers:

Column 13: Localized Directory Name, Sort Order, Converting Unicode to ANSI in Access, Converting numbers to Strings, IE for MUI, Office ToolsColumn 15: All About New Chinese Encoding GB-18030
*
On This Page
UTF–8 Codepage???UTF–8 Codepage???
Set font.charset for Visual Basic ControlSet font.charset for Visual Basic Control
Hebrew and XMLHebrew and XML
Three Letter Language AcronymsThree Letter Language Acronyms

UTF–8 Codepage???

Is there such a thing as a UTF–8 code page for Win95 and 98 and Win2000 clients?

We are planning to store UTF–8 data into VARCHAR LATIN 1 (I know that the column should probably be GRAPHIC or BINARY to be safe) database column and have it retrieved by the 95/98/2000 clients. Then we want to use the UTF–8 code page? to display & print the data. We are not fully ready for Unicode that is why we are trying to find a way to pass the data around without a lot of transformation.

decoder–8

Dr. International replies:

Dear decoder–8,

No, because UTF–8 is an encoding for Unicode, a UTF–8 codepage does not exist. That does not mean you can not display data encoded in UTF–8. For example, IE can do it even on Win9x. (this means, in particular, that some kind of a Web service / ASP page can push content in UTF–8 to Win95 clients)

You can process UTF–8 on all Windows platforms uniformly if you use MLang. It does not provide you with the means to display text, but you can convert UTF–8 to an encoding supported by the client before you display it.

Top of pageTop of page

Set font.charset for Visual Basic Control

Dear Dr. International,

Hi, what would be the "tidiest" way to set the font.charset property of a Visual Basic control based on the user's locale?

well organized

Dr. International replies:

Dear organized,

You have to use two Win32 APIs and one Win32–defined structure. With LCID in hand, call GetLocaleInfo to get the default ANSI codepage of the locale. Then create an instance of CHARSETINFO and pass it to TranslateCharsetInfo along with the codepage. The CHARSETINFO.ciCharset will contain the charset you need.

Top of pageTop of page

Hebrew and XML

Dear Dr. International,

I have a problem with Hebrew in xml.

I'm building a program in VB that puts an exchange message body, written in xml, into a string. When I use the xmlDoc.LoadXML command to read the string, I get ?????? instead of Hebrew. I have tried to add the tag <?xml version='1.0' encoding='windows–1255'?>, but when I do, I can't read the string at all.

The only way I have been able to read the data correctly is by adding the <?xml version='1.0' encoding='windows–1255'?> tag and my xml data into an attachment, and then open the attachment with FSO. I then save it as a temp file and read it with the xmlDoc.Load command.

Is there an easy way to fix the problem?

from the internet

Dr. International replies:

Dear from,

You may experience this problem for a couple of reasons. It depends on the version of the MSXML object you use:

1.

With versions 2.5, 2.5 SP1 and 2.6 of the MSXML parser, the loadXML method of IXMLDOMDocument can only load UTF–16 or UCS–2 encoded data. Any attempt to load XML data that is encoded with another encoding format results in an error.

2.

If you use MSXML ver. 3.0, the problem has been resolved – but note to make sure the encoding of the file matches the one declared in the header.

Top of pageTop of page

Three Letter Language Acronyms

Do you have a list of three letter acronyms (TLA) that the Microsoft Windows operating systems use for the sub–language of a Locale?

TLA–seeker

Dr. International replies:

Dear seeker,

Because I get this question a lot, I have added a list of these acronyms to Globaldev. It is a list of the 3–letter language codes that Windows XP uses for the languages of each of its supported locales.

Top of pageTop of page

Keep those questions coming!

Dr. International
Windows Division

Column 13: Localized Directory Name, Sort Order, Converting Unicode to ANSI in Access, Converting numbers to Strings, IE for MUI, Office ToolsColumn 15: All About New Chinese Encoding GB-18030
Top of pageTop of page