|
|
#1 |
|
VB6, XHTML & CSS hobbyist
Join Date: Oct 02
Location: Finland
Posts: 6,330
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Classic VB - Does Visual Basic 6 support Unicode?
Yes and no. For yes, VB strings can hold 16-bit characters and is thus Unicode compatible. The problems come from several directions:
Where are the controls? The worst news is that VB6 controls use ANSI. The VB propertybags can't hold Unicode data and VB runtime also passes the data to the controls after ANSI conversion. Thus none of the default controls can be used for Unicode. The only free choice left is to code the controls by yourself or to seek for controls done by others on the internet. The easy solution costs money: people are selling Unicode aware controls and there is no free version available for many. Personally, I've made a UniLabel and a UniCommand and both are available for free (link). Switching codepages This code is still a work in progress: it is a simple module that allows to switch between codepages. This includes UTF-8 conversions, which might be handy. The functions take in and return a byte array. This far I haven't found an error with the current code. Use GetACP to find out the default codepage the system has in use (this codepage is used when a file is loaded by VB into a string). VB Code:
Last edited by si_the_geek; Jun 17th, 2008 at 07:23 AM. Reason: updated link to controls |
|
|
|
|
|
#2 |
|
New Member
Join Date: Mar 06
Posts: 3
![]() |
Let me provide an alternative. You can use Office 2000 activeX controls, otherwise known as the Forms 2.0 (FM20.dll) I use in all the senerios (at least I think I have) that you mentioned.
But you say "But I have to purchase Office 2000 in order to use it. My clients will have to purchase Office 2000 to use it." Nope, luckily you and they don't have to. Microsoft provided a legal free version of using the control, but you have to download and install a program to do so... READ HERE -> INFO: Usage and Redistribution of FM20.DLL Download -> MS ActiveX Control Pad |
|
|
|
|
|
#3 | |
|
VBaholic & Loving It
Join Date: Oct 07
Location: GetWindowRect()
Posts: 7,668
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Classic VB - Does Visual Basic 6 support Unicode?
Quote:
Let's say that a string variable m_Text contains unicode data. To store and read the data via a userconrol's propertybag, one can do this: vb Code:
__________________
Insomnia is just a byproduct of, "It can't be done" Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum. Read the HitchHiker's Guide to Getting Help on the Forums. {Memory Leak FAQ} {GDI+ Classes/Samples} {Unicode Open/Save Dialog} {Icon Organizer/Extractor} {VBA Control Arrays} {XP/Vista Manifest Creator} {UserControl Button Template} {stdPicture Render Usage} Last edited by LaVolpe; Dec 7th, 2009 at 08:52 AM. Reason: clarify content |
|
|
|
|
![]() |
|
||||||
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|