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. How to convert ASCII to readable characters?

How to convert ASCII to readable characters?

Scheduled Pinned Locked Moved C#
questiondata-structurestutorial
5 Posts 4 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.
  • K Offline
    K Offline
    Khoramdin
    wrote on last edited by
    #1

    Hello everyone, I have an array which holds ASCII codes. How can I convert this to characters that I read?! ;P Thank you very much and have a great weekend. Khoramdin

    A 1 Reply Last reply
    0
    • K Khoramdin

      Hello everyone, I have an array which holds ASCII codes. How can I convert this to characters that I read?! ;P Thank you very much and have a great weekend. Khoramdin

      A Offline
      A Offline
      Anthony Mushrow
      wrote on last edited by
      #2

      Just cast the value as a char: char letter = array[0]; You can set a char using a letter 'a', an int 52, or a hex value 0x00 Of course you'll want some kind of loop to do that, and use an array of chars. Infact, there may be something in the string class, i'll go look now. -- modified at 18:47 Saturday 1st December, 2007 Aha, i knew that encoder class was somewhere:

      string myText = System.Text.ASCIIEncoding.ASCII.GetString(array);
      //array is an array of bytes

      My current favourite word is: PIE! I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for. -The Undefeated

      P 1 Reply Last reply
      0
      • A Anthony Mushrow

        Just cast the value as a char: char letter = array[0]; You can set a char using a letter 'a', an int 52, or a hex value 0x00 Of course you'll want some kind of loop to do that, and use an array of chars. Infact, there may be something in the string class, i'll go look now. -- modified at 18:47 Saturday 1st December, 2007 Aha, i knew that encoder class was somewhere:

        string myText = System.Text.ASCIIEncoding.ASCII.GetString(array);
        //array is an array of bytes

        My current favourite word is: PIE! I have changed my name to my regular internet alias. But don't let the 'Genius' part fool you, you don't know what 'SK' stands for. -The Undefeated

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #3

        Yeah they kinda hide it.

        P 1 Reply Last reply
        0
        • P PIEBALDconsult

          Yeah they kinda hide it.

          P Offline
          P Offline
          Paul Conrad
          wrote on last edited by
          #4

          PIEBALDconsult wrote:

          they kinda hide it

          It's fun finding little things like that.

          "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

          P 1 Reply Last reply
          0
          • P Paul Conrad

            PIEBALDconsult wrote:

            they kinda hide it

            It's fun finding little things like that.

            "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #5

            It's best when someone writes an article explaining their new super-fast method for doing something just to be told, "just use a System.Something".

            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