Results 1 to 6 of 6

Thread: Unicode in VB

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2001
    Location
    Vietnam
    Posts
    613

    Unicode in VB

    Can VB display VB code ? I want to set some unicode to the menu and label caption. If someone know, please help.

    Regards.

  2. #2
    Registered User Nucleus's Avatar
    Join Date
    Apr 2001
    Location
    So that's what you are up to ;)
    Posts
    2,530
    AFAIK, VB6 fully supports unicode data.

  3. #3
    Fanatic Member ExcalibursZone's Avatar
    Join Date
    Feb 2000
    Location
    Western NY State
    Posts
    908
    Yes indeed. Unicode is the default for VB. If you use the following code, you'll see that this is the case:
    Code:
    Dim Test As String
    Dim Test2() As Byte
    
    Test = "This is a test of VB's Unicode!"
    Test2 = Test
    
    For X = 0 To UBound(Test2)
        MsgBox Test2(X)
    Next X
    See all the entries that equal 0? That's the first half of the double byte unicode character. IE: 0 followed by 32 is the unicode ascii code 032 which corresponds to the space character. (or more precisely 000 032, Hex &0032)
    -Excalibur

  4. #4
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046
    check out the ascw(string) function.
    That might help you do what you need.

  5. #5
    Dreamlax
    Guest
    See all the entries that equal 0? That's the first half of the double byte unicode character. IE: 0 followed by 32 is the unicode ascii code 032 which corresponds to the space character. (or more precisely 000 032, Hex &0032) [/B]
    0x0032 = 50! The character should be 0x0020 (for space)! Sorry to be so picky, but I thought it might be confusing.

  6. #6
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    VB actually use a mutex between Unicode and ANSI strings.
    It handles all strings internally in memory using Unicode however all string functions use ANSI strings so VB converts back and forth between them.
    Also VB always pass a string to an API function as ANSI that's why we always use all the xxxA functions instead of the xxxW versions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width