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 / C++ / MFC
  4. converting ebcdic to ascii

converting ebcdic to ascii

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
3 Posts 3 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
    Camron
    wrote on last edited by
    #1

    I need a program to convert my text from ebcdic to ascii. Is there any tutorial or code out there that will help me do this?

    B D 2 Replies Last reply
    0
    • C Camron

      I need a program to convert my text from ebcdic to ascii. Is there any tutorial or code out there that will help me do this?

      B Offline
      B Offline
      BlackDice
      wrote on last edited by
      #2

      here's a function I used before: However, mine returns it as a string, so you'll have to do any other conversion on it yourself

      CString EBCDICToDecimal(CString strValue)
      {
              CString chr;
              char cEnd;
              int nLength = strValue.GetLength();
              cEnd = strValue[nLength - 1];
              chr = "";
              if((cEnd >= 65) && (cEnd <= 73)) cEnd -= 16;
              if(cEnd == 123) cEnd = 48;
              if(cEnd == 125)
              {
                      chr = "-";
                      cEnd = 48;
              }
              if((cEnd >= 74) && (cEnd <= 82))
              {
                      chr = "-";
                      cEnd -= 25;
              }
              strValue = chr + strValue.Left(strValue.GetLength() - 1) + cEnd;
              return strValue;
      }
      

      My articles www.stillwaterexpress.com BlackDice

      1 Reply Last reply
      0
      • C Camron

        I need a program to convert my text from ebcdic to ascii. Is there any tutorial or code out there that will help me do this?

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        See if this helps. In addition, there's these two:* http://support.microsoft.com/kb/216399/EN-US/

        • http://support.microsoft.com/default.aspx?scid=kb;EN-US;q235856


          "One must learn from the bite of the fire to leave it alone." - Native American Proverb

        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