First of all there is an article from Chilkat (another component vendor) about how to use the Font's charset (assuming it is a unicode font) to set different font types (you have to manually change the .frm since charset isn't exposed in the gui). Then all you have to do is convert from AnsiToUTF8 and back to support different languages (that is what Chilkat's control does).
Second, there are the Vesa Piittinen's free (Creative Commons, source included) VB6 controls for download here. They include Textbox, Label, Menu, List, Dialog, CommandButton, Caption (form's caption)). I haven't played with them much, but basically he is doing all the onPaint and the nice thing is that is all done in VB and you can look at the source.
One whacky option is to use API calls with the native VB6 controls - some pointers in Michael Kaplan's excellent book on Internationalization with VB6 and some sample code on his website too. But it would be lots of work. Do buy the book anyway as it's a gold mine of information on international issues in VB6. For instance the sample chapter explains your problems with Hebrew. Look for it secondhand as it's out of print.
Optional. When set to True the current selection is saved. When omitted or set to False or when no selection exists all the control contents are saved. This parameter must be set to False if the saving format is XML (10), CSS (11), AdobePDF (12) or AdobePDF/A (14).
If you are trying to display Unicode characters in VB6, your best course of action is to use the Microsoft Forms 2.0 controls (fm20.dll) instead of the default controls. These are Unicode-capable controls (text box, label, list box, etc.) that can display strings (Unicode) in any language. The default VB6 controls do not support Unicode, even though VB6 strings *are* Unicode, go figure! For me, internationalization is one of the biggest reasons for switching to .NET.
Provides all the important UI controls that are missing in VB6. Surprisingly flexible menus, toolbars, status bar, outlook, coolbar, treeview, option list, tab, property lists and toolboxes, and more.
This control can be used in Windows programming environments that support ActiveX, such as Visual Basic or Delphi as well as .NET and VBA driven applications such as Access. It can read and write a variety of file formats allowing for conversions to be made between them. Functions allow images to be manipulated, enhanced and edited. Images can be imported from TWAIN compliant scanners and webcams. The online manual provides a full listing of available properties and methods.
There are functions to save the image to file or copy the image to the Windows clipboard. The image can be exported in a binary format (a variant array), which can be used to place the image into a database field or stream the image to a web browser if used in a server-side application. An edited image can be posted to a web server as an HTTP upload, or by FTP.
We will only present the UTF-8 format because it tends to dominate because of its efficiency in terms of memory size and because of its backward compatibility with ASCII. Indeed, nothing distinguishes an old ASCII file from a UTF-8 file. Only when special characters are used will the UTF-8 file be distinguished from ASCII.
Regardless of the origin of a file, whether generated automatically, or sent by a data provider, or built manually, it may be useful to verify with absolute certainty its format and to show the possible tag BOM.
In case there is a BOM tag at the very beginning of the file then it is a text using the Unicode format: UTF-8 = EF BB BF UTF-16 Big Endian = FE FF UTF-16 Little Endian = FF FE UTF-32 Big Endian = 00 00 FE FF UTF-32 Little Endian = FF FE 00 00
The VBA function AscW() goes the other way, and has the same ISO problems. It will tell you the decimal code of the first character in a Unicode string, with no regard to the Windows character set. We can make another UDF CODEW() that can optionally specify either the decimal or hex value for the first character is returned, and whether or not to be ISO compliant. The default is to return the HEX unicode (as Uxxxx) and not to comply.
After you store each byte character that you want to display, use a text box or a label control to display the characters on the user's screen. VB translates the characters to the proper format, so you do not need to manually convert the characters to the standard string format. The following code displays the character in a text box named "mybox":
In addition to using Unicode characters for special characters, you can specify a special character by including control information in the text string. Use a pair of percent signs (%%) to introduce each control sequence. For example, the following control code works with standard AutoCAD text and PostScript fonts to draw character number nnn:
Although Visual Basic 6.0 stores strings internally as Unicode(UTF-16) it has several limitations: Ships with ANSI only controls (Label, Textbox, etc.). Properties Window in IDE is ANSI only. Unicode strings are displayed as '????' PropertyBag automatically converts Unicode strings to ANSI. Clipboard functions are ANSI only. Menus are ANSI only.
The standard VB6 textbox and label controls display the ANSI bytes according to a character encoding that you can specify. After the Unicode-to-ANSI conversion, VB6 then attempts to display the character data according to the control's Font.Charset property, which if left unchanged is equal to the ANSI charset.
For complete list of supported languages please go to www.unicode.org. To embed UNICODE characters into your VB application, add a built-in component named "Microsoft Forms 2.0 Object Library" from Components Dialog Box. You can get Components dialog box by Pressing CTRL+T.
VB6 stores strings in Unicode format. In COM terminology, a VB String is a BSTR. A String requires six overhead bytes plus 2 bytes for each character. Thus, you spend 6 + Len(string)*2 bytes for each string. The string starts with a 4-byte length prefix for the size of the string. It's not the character length, though.
UNICODE Controls and Classes for Visual Basic 6, UNICODE Controls, OwnerDrawn Controls, OwnerDrawn Menu, Custom Controls, Icon Menu, Glass interface, Design in Unicode from VB6, UTF8/UTF16 Converter, GdiPlus, WindowLess controls, antialiasing support, 32 bpp alpha images support, RTL support, IME support, Unicode shell links support, Unicode Drag&Drop.
This component provides Unicode supportted controls, such as: textbox, label, command button,list box, combo box, checkbox, radio button, toggle button, image, tabstrip, and multiple page control. Working with VB6 and displaying non-us-ANSI characters you need 3 main things to understand: Internally, VB6 stores strings as Unicode. When displaying a string, the standard VB6 textbox and label controls do an implicit (and internal) conversion from Unicode to ANSI.
To embed UNICODE characters into your VB application, add a built-in component named "Microsoft Forms 2.0 Object Library" from Components Dialog Box. You can get Components dialog box by Pressing CTRL+T This gives you 14 new controls in your toolbox, including TextBox, Label, CommandButton, ListBox, ComboBox, CheckBox, Radio Buttons and a few more.
Solution 1. Short and best answer: get rid of VB and try to forget it as soon as you can. VB6 controls don't support Unicode. Most modern systems works with Unicode for a long time already. Showing so popular Unicode Perso-Arabic script -Arabic_script [ ^] was never a problem.
Dim unicodeBytes As Byte() = unicode.GetBytes(unicodeString) ' Perform the conversion from one encoding to the other. Dim asciiBytes As Byte() = Encoding.Convert(unicode, ascii, unicodeBytes) ' Convert the new byte array into a char array and then into a string.
re: unicode to ascii in vb6 There is one other scenario where the file can retain the BOM marker. If the old file is not really deleted and it was Unicode before, when you open it and use Put it may in fact retain the BOM marker.
Internal to VB6, the runtime is converting Unicode to the current Windows ANSI code page identifier for the operating system. There is no way to change this conversion short of changing the ANSI code page for the system. The standard VB6 textbox and label controls display the ANSI bytes according to a character encoding that you can specify.
Internally, VB6 stores strings as Unicode. When displaying a string, the standard VB6 textbox and label controls do an implicit (and internal) conversion from Unicode to ANSI. The standard VB6 textbox and label controls display the ANSI bytes according to a character encoding that you can specify.
Here are some examples for using unicode in vb6. Vb6 uses string as utf16 and in a picture box with a drawtext function we can display that code. In other cases vb6 check if each utf16 code in the string has a equivalent in ANSI user charset and if not fount the replace the char with a question mark. This is done with any print command.
VB6 stores strings in Unicode format. In COM terminology, a VB String is a BSTR. A String requires six overhead bytes plus 2 bytes for each character. Thus, you spend 6 + Len (string)*2 bytes for each string.
You can embed any language from Chinese to Japanese, Arabic to Urdu, Hindi and hundreds of more.. For complete list of supported languages please go to www.unicode.org To embed UNICODE characters into your VB application, add a built-in component named "Microsoft Forms 2.0 Object Library" from Components Dialog Box.
Using ListBox and ComboBox Controls In Visual Basic 6 ListBox and ComboBox controls present a set of choices that are displayed vertically in a column. If the number of items exceed the value that be displayed, scroll bars will automatically appear on the control.