Unicode Controls & Classes for VB6 - Version 4

ctlUniMenu.StringMode Property

Specify the type of encoding used by menu items

Public Property Get StringMode () As eUniMenuStringMode
Public Property Let StringMode (ByRef i As eUniMenuStringMode)
Parameter Description
ByRef i As eUniMenuStringMode The encoding to use for translating menu items in Unicode
You should not use the StringMode=UTF8 if you need to use a Unicode language; you have to use the StringMode=Hex instead.

The UTF8 encoding cannot be used as a string container for menu controls in many systems because it can contain the full set of ANSI chars (0..255, supported only in full ANSI systems like US, GB, IT, etc...); for example in Chinese/Vietnamese systems, some chars were lost and the menu doesn't work correctly. Now it is possible to use a special encoding for the menu. You can translate strings from UTF16 to Hexadecimal values using the [clsCommonWrapper.HexToStr] or [clsCommonWrapper.StrToHex] functions. The menu can be set to Hex mode as it is able to check Hexadecimal strings and translate them if needed.
It is possible to manually check if a string is encoded in Hex using the function [clsCommonWrapper.IsHexString]

Hexadecimal encoding
This is a quite simple translation of an Unicode string using the Base64 encoding plus some control chars. The first two letters represent the Hex identifier, the last two bytes of the string contain the XOR hexadecimal value of every character index so it is simple to check for an Hexadecimal encoded string :-)

For example the italian string "pippo" is encoded in Hex as "0XcABpAHAAcABvAA==0F" that should be fully compatible with all systems because it uses only numbers and very few ANSI letters.

Unicode Stringpippo
Hexadecimal Encoding0X