none
Displaying Big Unicode values (characters) in listview. RRS feed

  • Question

  • Hi Folks,

    I'm writing an email viewer in VB.NET and am having one problem that I can't find an answer to, that is displaying large UTF8 values.

    I recently received an email from NASA that finished off with a rocket symbol.  That's U+7DA00, or =F0=9F=9A=80

    How to I display this character in listview.

    Thanks in advance.

    Tuesday, October 8, 2019 3:05 PM

Answers

  • Hi Viorel,


    I have a follow up question.  When the subject is displayed in an email client the, underscores are replaced with spaces.  Any idea why that is?


    Probably he knows, but if he is a good forum contributor he does not answer that. Simply mark his reply as answer, give him helpful votes and create a new question. 


    Success
    Cor

    • Marked as answer by OzMaz Wednesday, October 9, 2019 1:11 PM
    Wednesday, October 9, 2019 11:02 AM

All replies

  • If the font is suitable, then this text seems to work:

      Dim text = "Rocket: " & ChrW(&HD83D) & ChrW(&HDE80)

      ListView1.Items.Add(text)

     

    In case of UTF-8 bytes, this works too:

      Dim utf8bytes As Byte() = {&HF0, &H9F, &H9A, &H80}

      Dim text = Encoding.UTF8.GetString(utf8bytes)

     

    Make sure that the UTF-8 data are correctly received and processed.

    Tuesday, October 8, 2019 4:00 PM
  • Hi Viorel,

    I used the second example as I don't understand the first example although both work.

    The full subject text is:

    " #AskNASA_|_How_Are_We_Going_to_the_Moon?_=F0=9F=9A=80"

    I worked out the value of =F0=9F=9A=80 as &H7DA00, but I don't know what do with it.

    I recoded and just used the raw values and it works very well indeed.

    I have a follow up question.  When the subject is displayed in an email client the, underscores are replaced with spaces.  Any idea why that is?

    Thanks for your most valuable help.

    Wednesday, October 9, 2019 9:47 AM
  • Hi Viorel,


    I have a follow up question.  When the subject is displayed in an email client the, underscores are replaced with spaces.  Any idea why that is?


    Probably he knows, but if he is a good forum contributor he does not answer that. Simply mark his reply as answer, give him helpful votes and create a new question. 


    Success
    Cor

    • Marked as answer by OzMaz Wednesday, October 9, 2019 1:11 PM
    Wednesday, October 9, 2019 11:02 AM