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. .NET (Core and Framework)
  4. How to encode an extended ASCII in .NET?

How to encode an extended ASCII in .NET?

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpc++comcollaborationtutorial
3 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.
  • V Offline
    V Offline
    Venkatesh Mookkan
    wrote on last edited by
    #1

    Hi All, I have an application with sends request to a C++ CGI. The response stream comes with a delimiter ( ASC (143) ). I used ASCIIEncoding which returns the data correctly buy wrongly decoded delimiter (I got "?" instead of ASC 143). I tried UTF7Encoding which returned the delimiter correctly but some data are lost. Does any one has solution for this? I cannot cannot change the CGI layer as its servers as router of more of our legacy applications and my Team Leaders feels that CGI is in perfect shape. Earlier answers would be appreciated. Thanks in ASAP.

    Venkatesh Mookkan


    My: Website | Yahoo Group | Blog Spot

    L 1 Reply Last reply
    0
    • V Venkatesh Mookkan

      Hi All, I have an application with sends request to a C++ CGI. The response stream comes with a delimiter ( ASC (143) ). I used ASCIIEncoding which returns the data correctly buy wrongly decoded delimiter (I got "?" instead of ASC 143). I tried UTF7Encoding which returned the delimiter correctly but some data are lost. Does any one has solution for this? I cannot cannot change the CGI layer as its servers as router of more of our legacy applications and my Team Leaders feels that CGI is in perfect shape. Earlier answers would be appreciated. Thanks in ASAP.

      Venkatesh Mookkan


      My: Website | Yahoo Group | Blog Spot

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      You have an encoding problem, which you should try and solve using the Encoding class. There is no such thing as an extended ASCII encoding, or almost everything is an extended ASCII encoding, i.e. most encodings use more than 128 characters and keep the first 128 compatible with ASCII for obvious reasons. Try using Encoding encoding=new Encoding(codepage); where codepage is an appropriate integer value. In Western-Europe 1252 would be the first one to try. I can't tell for your region though. Once you have the right Encoding object, either use some of its methods to perform a conversion, or better yet, pass it as an extra parameter to your file operations, e.g. File.ReadAllText(String, Encoding) :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

      Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

      V 1 Reply Last reply
      0
      • L Luc Pattyn

        You have an encoding problem, which you should try and solve using the Encoding class. There is no such thing as an extended ASCII encoding, or almost everything is an extended ASCII encoding, i.e. most encodings use more than 128 characters and keep the first 128 compatible with ASCII for obvious reasons. Try using Encoding encoding=new Encoding(codepage); where codepage is an appropriate integer value. In Western-Europe 1252 would be the first one to try. I can't tell for your region though. Once you have the right Encoding object, either use some of its methods to perform a conversion, or better yet, pass it as an extra parameter to your file operations, e.g. File.ReadAllText(String, Encoding) :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

        Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

        V Offline
        V Offline
        Venkatesh Mookkan
        wrote on last edited by
        #3

        Thanks for your time. I got the answers from MSDN Forums[^]

        Venkatesh Mookkan


        My: Website | Yahoo Group | Blog Spot

        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