Results 1 to 7 of 7

Thread: unicode?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227

    unicode?

    i know for example that "069B" represents the char that i want in unicode, now how can i show that char for example in a label?

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    anybody with any ideas??????
    i think it should look something like this ...
    Code:
            Dim a() As Byte = {"069B"}   ' this is where i'm stuck
            Dim chars() As Char
            Dim enc As New System.Text.UnicodeEncoding()
            chars = enc.GetChars(a)
            Label1.Text = chars(0)

    but how to we asign the value to the byte, its a hex value


    thanks

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    what i really want to to is just enumerate through unicode ( availibe ranges ) charecters and show them in a label or something

    it shouldn't be that i hard ,i just cant figure it out myself, any help is appreciated

  4. #4
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    to convert it from hex to unicode , you can use ALT & x in a richtextbox , make a temporary richtextbox , add it to your controls , use sendkeys, then remove it from your controls. eg:
    VB Code:
    1. Dim strHex As String = "069B"
    2.         Dim rtbox As New RichTextBox()
    3.         rtbox.Height = 1
    4.         rtbox.Width = 1
    5.         Controls.Add(rtbox)
    6.         rtbox.Text = strHex
    7.         rtbox.SelectAll()
    8.         rtbox.Focus()
    9.         SendKeys.SendWait("%(x)")
    10.         MessageBox.Show(rtbox.Text)
    11.  
    12.         Controls.Remove(rtbox)
    13.         rtbox = Nothing
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    it keeps showing this vertical line for every entery!?

    shouldnt there be another easier way to do it? is there any base type that can hold hex values, so we can just pass it to the encoding.getchars method?

  6. #6
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    VB Code:
    1. Dim c as Char=ChrW(&H69B)
    And if you are concered about using a string as "069B" then
    VB Code:
    1. Dim c as Char=ChrW(Integer.Parse("069B", Globalization.NumberStyles.HexNumber))
    And if you want its .NET way then
    VB Code:
    1. Dim c As Char = Convert.ToChar(Integer.Parse("069B", Globalization.NumberStyles.HexNumber))

    That's it.
    Last edited by Lunatic3; Dec 13th, 2003 at 08:00 AM.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    wow, thanks

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