How to translate EBCdic 1388 to gb2312 in .net? [modified]
-
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
-
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
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.
-
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.
-
TextPipe is a software, not source code. I need a way to translate the code in .net framework. thank you , anyway.
hope for help
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.
-
TextPipe is a software, not source code. I need a way to translate the code in .net framework. thank you , anyway.
hope for help
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! -
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! -
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.
-
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
Hi there, Is there any solutions, as I have come across the same question. Wish for you reply, thanks.