How to support Unicode characters throughout VB 6.0 applications

I encountered a problem that Unicode characters are not supported in a VB 6.0 application. I need to set Chinese characters in the record set field in my application-(the size of each field It is set from the program itself). If we set Chinese characters to the record set field, there will be a multi-step operation error (because the retention field size is not enough). If we set the language to Chinese from the regional settings of the server control panel (Control Panel>Regional and Language Settings>Management Tab>Change System Locale…>to Chinese), this error will not be triggered

If we set this, then our application’s The time setting will change. I need some help from the control panel to change how we can solve this problem.

Please help.

Thanks in advance.

< div class="content-split">

In Windows, you can set the locale to Chinese while retaining the time and date format. http://www.techpavan.com /2009/04/07/change-time-format-windows/

In order to use Unicode in Visual Basic 6 applications, here is an article with detailed explanation and examples: http:/ /www.example-code.com/vb/vbUnicode1.asp

Quote this link:

Internally, VB6 stores strings as Unicode. Your VB6 program is capable of manipulating strings in any language containing any character — whether it’s Chinese, Japanese, Icelandic, Arabic, etc. It’s fully Unicode capable. A single string may contain characters in multiple languages. You can save these strings to databases, files, etc., and the re shouldn’t be a problem. Problems arise only when trying to display (ie render the glyphs) for foreign characters in the standard VB6 controls.

When displaying a string, the standard VB6 textbox and label controls do an implicit (and internal) conversion from Unicode to ANSI. This is the confounding behavior that causes all the trouble. 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. 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. Changing the control’s Font.Charset changes the way VB6 interprets the “ANSI” bytes. In other words, you’re telling VB6 to treat the bytes as some other character encoding instead of “ANSI”. Note: VB6 is capable of displaying characters in all the major languages. It simply needs to be told to do so, and the correct bytes need to be in place internally for it to happen.

I encountered Unicode character not supported in VB 6.0 application The problem. I need to set Chinese characters in the record set field in my application-(the size of each field is set from the program itself). If we set Chinese characters to the record set field, there will be more Step operation error (because the remaining field size is not enough). If we set the language to Chinese from the regional settings of the server control panel (Control Panel>Regional and Language Settings>Management Tab>Change System Regional Settings…>to Chinese), then This error will not be triggered

If we set this, then the time setting of our application will change. I need some help to change how we can solve this problem from the control panel.

Please help.

Thanks in advance.

In Windows, you can set the locale to Chinese while keeping Time and date format. http://www.techpavan.com/2009/04/07/change-time-format-windows/

In order to use Unicode in Visual Basic 6 applications, Here is an article with detailed explanation and examples: http://www.example-code.com/vb/vbUnicode1.asp

Quote this link:

Internally, VB6 stores strings as Unicode. Your VB6 program is capable of manipulating strings in an y language containing any character — whether it’s Chinese, Japanese, Icelandic, Arabic, etc. It’s fully Unicode capable. A single string may contain characters in multiple languages. You can save these strings to databases, files, etc., and there shouldn’ t be a problem. Problems arise only when trying to display (ie render the glyphs) for foreign characters in the standard VB6 controls.

When displaying a string, the standard VB6 textbox and label controls do an implicit (and internal) conversion from Unicode to ANSI. This is the confounding behavior that causes all the trouble. 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.< /strong> 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. Changing the control’s Font.Charset changes the way VB6 interprets the “ANSI” bytes. In other words, you’re telling VB6 to treat the bytes as some other character encoding instead of “ANSI”. Note: VB6 is capable of displaying characters in all the major languages. It simply needs to be told to do so, and the correct bytes need to be in place internally for it to happen.

Leave a Comment

Your email address will not be published.