Has anyone tried to download a mainframe file with FtpWebRequest. It doesn't
seem to translate from EBCDIC to ASCII.
The old inet control in VB6 has the same problem.
Command line FTP has no problem to translate from EBCDIC to ASCII, but I
prefer a .Net assembly.

Re: FtpWebRequest in 2.0 Framework by Joerg

Joerg
Mon Nov 28 12:40:04 CST 2005

Arne wrote:

> Has anyone tried to download a mainframe file with FtpWebRequest. It
> doesn't seem to translate from EBCDIC to ASCII.
> The old inet control in VB6 has the same problem.
> Command line FTP has no problem to translate from EBCDIC to ASCII,
> but I prefer a .Net assembly.

Why can't you download it as binary and use System.Text.Encoding to
convert from EBCDIC? Windows supports tons of EBCDIC encodings -- see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/un
icode_81rn.asp.


Cheers,
--
http://www.joergjooss.de
mailto:news-reply@joergjooss.de

Re: FtpWebRequest in 2.0 Framework by Arne

Arne
Mon Nov 28 15:46:22 CST 2005

Joerg Jooss,
I tried your link and I got 'Location Cannot Be Found'. I have looked at
System.Text.Encoding, but I have not found anything on EBCDIC yet.

Arne

"Joerg Jooss" wrote:

> Arne wrote:
>
> > Has anyone tried to download a mainframe file with FtpWebRequest. It
> > doesn't seem to translate from EBCDIC to ASCII.
> > The old inet control in VB6 has the same problem.
> > Command line FTP has no problem to translate from EBCDIC to ASCII,
> > but I prefer a .Net assembly.
>
> Why can't you download it as binary and use System.Text.Encoding to
> convert from EBCDIC? Windows supports tons of EBCDIC encodings -- see
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/un
> icode_81rn.asp.
>
>
> Cheers,
> --
> http://www.joergjooss.de
> mailto:news-reply@joergjooss.de
>

Re: FtpWebRequest in 2.0 Framework by Arne

Arne
Mon Nov 28 16:23:02 CST 2005

Joerg Jooss,
http://msdn2.microsoft.com/library/system.text.encoding.aspx
States that EBCDIC is not supported.
Arne.

"Joerg Jooss" wrote:

> Arne wrote:
>
> > Has anyone tried to download a mainframe file with FtpWebRequest. It
> > doesn't seem to translate from EBCDIC to ASCII.
> > The old inet control in VB6 has the same problem.
> > Command line FTP has no problem to translate from EBCDIC to ASCII,
> > but I prefer a .Net assembly.
>
> Why can't you download it as binary and use System.Text.Encoding to
> convert from EBCDIC? Windows supports tons of EBCDIC encodings -- see
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/un
> icode_81rn.asp.
>
>
> Cheers,
> --
> http://www.joergjooss.de
> mailto:news-reply@joergjooss.de
>

Re: FtpWebRequest in 2.0 Framework by Arne

Arne
Mon Nov 28 16:28:02 CST 2005

This one works
http://www.eggheadcafe.com/articles/20030521.asp

"Joerg Jooss" wrote:

> Arne wrote:
>
> > Has anyone tried to download a mainframe file with FtpWebRequest. It
> > doesn't seem to translate from EBCDIC to ASCII.
> > The old inet control in VB6 has the same problem.
> > Command line FTP has no problem to translate from EBCDIC to ASCII,
> > but I prefer a .Net assembly.
>
> Why can't you download it as binary and use System.Text.Encoding to
> convert from EBCDIC? Windows supports tons of EBCDIC encodings -- see
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/un
> icode_81rn.asp.
>
>
> Cheers,
> --
> http://www.joergjooss.de
> mailto:news-reply@joergjooss.de
>

Re: FtpWebRequest in 2.0 Framework by Joerg

Joerg
Tue Nov 29 14:40:15 CST 2005

Arne wrote:

> Joerg Jooss,
> http://msdn2.microsoft.com/library/system.text.encoding.aspx
> States that EBCDIC is not supported.

No, it doesn't. It's just not a complete list. Try:

static void EbcdicDemo()
{
Encoding e = Encoding.GetEncoding(37);
Console.WriteLine(e.EncodingName);
}

(I have no idea why Jon implemented his own EBCDIC classes.)

Cheers
--
http://www.joergjooss.de
mailto:news-reply@joergjooss.de

Re: FtpWebRequest in 2.0 Framework by Arne

Arne
Tue Nov 29 15:46:01 CST 2005

Joerg Jooss,
We seem to be halfway there. I still don't understand how to decode a string.

Arne.

"Joerg Jooss" wrote:

> Arne wrote:
>
> > Joerg Jooss,
> > http://msdn2.microsoft.com/library/system.text.encoding.aspx
> > States that EBCDIC is not supported.
>
> No, it doesn't. It's just not a complete list. Try:
>
> static void EbcdicDemo()
> {
> Encoding e = Encoding.GetEncoding(37);
> Console.WriteLine(e.EncodingName);
> }
>
> (I have no idea why Jon implemented his own EBCDIC classes.)
>
> Cheers
> --
> http://www.joergjooss.de
> mailto:news-reply@joergjooss.de
>

Re: FtpWebRequest in 2.0 Framework by Arne

Arne
Tue Nov 29 15:59:04 CST 2005

Joerg Jooss,
The Microsoft way
Dim e37 As Encoding
Dim ascii As Encoding
e37 = Encoding.GetEncoding(37)
ascii = Encoding.ASCII
Dim asciiBytes As Byte() = Encoding.Convert(e37, ascii, encoded)
Dim asciiChars(ascii.GetCharCount(asciiBytes, 0, asciiBytes.Length)) As
Char
ascii.GetChars(asciiBytes, 0, asciiBytes.Length, asciiChars, 0)
buf = New String(asciiChars)

The Jon way
Dim ebc As EbcdicEncoding
ebc = EbcdicEncoding.GetEncoding("EBCDIC-US")
buf = ebc.GetString(encoded)

Is there an easier way?


"Joerg Jooss" wrote:

> Arne wrote:
>
> > Joerg Jooss,
> > http://msdn2.microsoft.com/library/system.text.encoding.aspx
> > States that EBCDIC is not supported.
>
> No, it doesn't. It's just not a complete list. Try:
>
> static void EbcdicDemo()
> {
> Encoding e = Encoding.GetEncoding(37);
> Console.WriteLine(e.EncodingName);
> }
>
> (I have no idea why Jon implemented his own EBCDIC classes.)
>
> Cheers
> --
> http://www.joergjooss.de
> mailto:news-reply@joergjooss.de
>

Re: FtpWebRequest in 2.0 Framework by Joerg

Joerg
Tue Nov 29 16:32:37 CST 2005

Arne wrote:

> Joerg Jooss,
> The Microsoft way
> Dim e37 As Encoding
> Dim ascii As Encoding
> e37 = Encoding.GetEncoding(37)
> ascii = Encoding.ASCII
> Dim asciiBytes As Byte() = Encoding.Convert(e37, ascii, encoded)
> Dim asciiChars(ascii.GetCharCount(asciiBytes, 0,
> asciiBytes.Length)) As Char
> ascii.GetChars(asciiBytes, 0, asciiBytes.Length, asciiChars, 0)
> buf = New String(asciiChars)
>
> The Jon way
> Dim ebc As EbcdicEncoding
> ebc = EbcdicEncoding.GetEncoding("EBCDIC-US")
> buf = ebc.GetString(encoded)
>
> Is there an easier way?

There's no MS way, nor is there a Jon way. All implementations are
derived from the base class System.Text.Encoding, thus you can use
GetString() in the first example as well.

Cheers,
--
http://www.joergjooss.de
mailto:news-reply@joergjooss.de