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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Converting a char array containing ASCII values to Unicode string

Converting a char array containing ASCII values to Unicode string

Scheduled Pinned Locked Moved C#
csharpdata-structurestutorial
4 Posts 2 Posters 1 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.
  • J Offline
    J Offline
    jayshml
    wrote on last edited by
    #1

    Hi, how to convert a character array containing ascii values to unicode string in C#. Thanks Jayshri

    G 1 Reply Last reply
    0
    • J jayshml

      Hi, how to convert a character array containing ascii values to unicode string in C#. Thanks Jayshri

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Can you describe the source data a bit more specific? As an array of Char is not ASCII in C#, either you don't mean that or you don't have what you think you do. --- b { font-weight: normal; }

      J 1 Reply Last reply
      0
      • G Guffa

        Can you describe the source data a bit more specific? As an array of Char is not ASCII in C#, either you don't mean that or you don't have what you think you do. --- b { font-weight: normal; }

        J Offline
        J Offline
        jayshml
        wrote on last edited by
        #3

        Actually here is what i want to do: byte[] buffer = new byte[buffersize]; baseStream.Read(buffer, 0, buffer.Length); where basestrem is a network stream. now I want to convert this byte array to a string containing unicode values.

        G 1 Reply Last reply
        0
        • J jayshml

          Actually here is what i want to do: byte[] buffer = new byte[buffersize]; baseStream.Read(buffer, 0, buffer.Length); where basestrem is a network stream. now I want to convert this byte array to a string containing unicode values.

          G Offline
          G Offline
          Guffa
          wrote on last edited by
          #4

          Use a streamreader to read the stream with the correct encoding (making the buffer obsolete), or use ASCIIEncoding.GetString to decode the buffer. --- b { font-weight: normal; }

          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