Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Array of bytes to Korean chars array?

Array of bytes to Korean chars array?

Scheduled Pinned Locked Moved C#
data-structuresquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cptkli
    wrote on last edited by
    #1

    Hi, i have an array of bytes i need to convert to a Korean string but i don't know how. I tried char[] chars_array = System.Text.Encoding.GetEncoding(949).GetString(bytes_array).ToCharArray(); korean_string = new String(char_array); but it ends with square and ! ? characters. Any idea :confused:

    M 1 Reply Last reply
    0
    • C Cptkli

      Hi, i have an array of bytes i need to convert to a Korean string but i don't know how. I tried char[] chars_array = System.Text.Encoding.GetEncoding(949).GetString(bytes_array).ToCharArray(); korean_string = new String(char_array); but it ends with square and ! ? characters. Any idea :confused:

      M Offline
      M Offline
      mid 5741
      wrote on last edited by
      #2

      Where does the array of bytes come from? Have you tried different encodings, like UTF-8 or UTF-16?

      C 1 Reply Last reply
      0
      • M mid 5741

        Where does the array of bytes come from? Have you tried different encodings, like UTF-8 or UTF-16?

        C Offline
        C Offline
        Cptkli
        wrote on last edited by
        #3

        Thanks it helped, i just found char[] array_country = System.Text.Encoding.Unicode.GetString(byte_country).ToCharArray(); string_country = new String(array_country); MessageBox.Show(string_country); works perfectly, the message box show the good string in Korean. I then add the string to a listview, so is there any option to set to show the Korean characters in the listview? *edit ok it's resolved the problem came from the font i used in the listview ;P -- modified at 18:45 Saturday 1st December, 2007

        M 1 Reply Last reply
        0
        • C Cptkli

          Thanks it helped, i just found char[] array_country = System.Text.Encoding.Unicode.GetString(byte_country).ToCharArray(); string_country = new String(array_country); MessageBox.Show(string_country); works perfectly, the message box show the good string in Korean. I then add the string to a listview, so is there any option to set to show the Korean characters in the listview? *edit ok it's resolved the problem came from the font i used in the listview ;P -- modified at 18:45 Saturday 1st December, 2007

          M Offline
          M Offline
          mid 5741
          wrote on last edited by
          #4

          You may have to change the font that your listview uses to show Korean. There's a universal Arial font that has CJK characters. By the way, I took your Korean characters and pasted them into a text file in VS2005 and saved it with 'Unicode - Codepage 1200' encoding. After the identifying BOM in the file, I get: 74 C7 C8 D0 AC B9 44 C5.

          Cyril Connolly wrote:

          Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups