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 translate EBCdic 1388 to gb2312 in .net? [modified]

How to translate EBCdic 1388 to gb2312 in .net? [modified]

Scheduled Pinned Locked Moved .NET (Core and Framework)
questioncsharpdotnethelptutorial
8 Posts 4 Posters 36 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.
  • W Offline
    W Offline
    welsrping
    wrote on last edited by
    #1

    hello,everyone. I have come to the follow question. A file from Host (AS/400 or IBM 9000) in EBCDIC(ibm 1388 or cp935) encode , include some chinese chars. Now, I would translate the string in this file to chinese chars in Windows OS and .net Framework, which is gb2312 encode. I have search many archives, but can't find a way. Please help me ! Thanks.

    hope for help

    modified on Saturday, July 4, 2009 10:40 AM

    D 1 Reply Last reply
    0
    • W welsrping

      hello,everyone. I have come to the follow question. A file from Host (AS/400 or IBM 9000) in EBCDIC(ibm 1388 or cp935) encode , include some chinese chars. Now, I would translate the string in this file to chinese chars in Windows OS and .net Framework, which is gb2312 encode. I have search many archives, but can't find a way. Please help me ! Thanks.

      hope for help

      modified on Saturday, July 4, 2009 10:40 AM

      D Offline
      D Offline
      David Skelly
      wrote on last edited by
      #2

      A quick scan of google brings up a product called TextPipe Pro which claims to do it. Not sure if that helps you or not but it might be worth looking at if all else fails.

      W 1 Reply Last reply
      0
      • D David Skelly

        A quick scan of google brings up a product called TextPipe Pro which claims to do it. Not sure if that helps you or not but it might be worth looking at if all else fails.

        W Offline
        W Offline
        welsrping
        wrote on last edited by
        #3

        TextPipe is a software, not source code. I need a way to translate the code in .net framework. thank you , anyway.

        hope for help

        D V 2 Replies Last reply
        0
        • W welsrping

          TextPipe is a software, not source code. I need a way to translate the code in .net framework. thank you , anyway.

          hope for help

          D Offline
          D Offline
          David Skelly
          wrote on last edited by
          #4

          A quick scan of google brings up some examples of converting between GB2312 and unicode.

          static void Main(string[] args) {
          string infile = args[0];
          string outfile = args[1];
          using (StreamReader sr = new StreamReader(infile, Encoding.GetEncoding(936))) {
          using (StreamWriter sw = new StreamWriter(outfile, false, Encoding.UTF8)) {
          sw.Write(sr.ReadToEnd());
          sw.Close();
          }
          sr.Close();
          }
          }

          It shouldn't be too hard to start from that and figure out how to convert from EBCDIC.

          W 1 Reply Last reply
          0
          • W welsrping

            TextPipe is a software, not source code. I need a way to translate the code in .net framework. thank you , anyway.

            hope for help

            V Offline
            V Offline
            Vasudevan Deepak Kumar
            wrote on last edited by
            #5

            Along with David's note, check out this: http://msdn.microsoft.com/hi-in/library/system.text.encodinginfo(en-us,VS.80).aspx[^]

            Vasudevan Deepak Kumar Personal Homepage
            Tech Gossips
            The woods are lovely, dark and deep, But I have promises to keep, And miles to go before I sleep, And miles to go before I sleep!

            W 1 Reply Last reply
            0
            • V Vasudevan Deepak Kumar

              Along with David's note, check out this: http://msdn.microsoft.com/hi-in/library/system.text.encodinginfo(en-us,VS.80).aspx[^]

              Vasudevan Deepak Kumar Personal Homepage
              Tech Gossips
              The woods are lovely, dark and deep, But I have promises to keep, And miles to go before I sleep, And miles to go before I sleep!

              W Offline
              W Offline
              welsrping
              wrote on last edited by
              #6

              By the way you supply, we can only translate IBM EBCDIC 037 or 500 to 936(gb2312), but can't translate the 1388 encode. I think it maybe the there is not the 1388 encode in the EcodeInfo class. Why .net doesn't supply this???:confused:

              hope for help

              J 1 Reply Last reply
              0
              • D David Skelly

                A quick scan of google brings up some examples of converting between GB2312 and unicode.

                static void Main(string[] args) {
                string infile = args[0];
                string outfile = args[1];
                using (StreamReader sr = new StreamReader(infile, Encoding.GetEncoding(936))) {
                using (StreamWriter sw = new StreamWriter(outfile, false, Encoding.UTF8)) {
                sw.Write(sr.ReadToEnd());
                sw.Close();
                }
                sr.Close();
                }
                }

                It shouldn't be too hard to start from that and figure out how to convert from EBCDIC.

                W Offline
                W Offline
                welsrping
                wrote on last edited by
                #7

                This can only trans 936 to Utf8, can't translate 1388 to 936.

                hope for help

                1 Reply Last reply
                0
                • W welsrping

                  By the way you supply, we can only translate IBM EBCDIC 037 or 500 to 936(gb2312), but can't translate the 1388 encode. I think it maybe the there is not the 1388 encode in the EcodeInfo class. Why .net doesn't supply this???:confused:

                  hope for help

                  J Offline
                  J Offline
                  Jiang Mike
                  wrote on last edited by
                  #8

                  Hi there, Is there any solutions, as I have come across the same question. Wish for you reply, thanks.

                  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