Jon,
Thanks for the quick reply - I will look it over and try to work on it this
week.
One question I have that hopefully you can answer:
When I specify Encoding ebcdic = Encoding.GetEncoding("IBM01140");
Is there way to see the actual table for this particular encoding, perhaps
in a *.h file?
The reason I ask, is we have an internal table that we use for ASCII-EBCDIC
conversions, based on a table from one of our vendors. I am sure it is a
"flavor" of the IBM conversion, but I would like to compare it to what
Microsoft is doing to see if it matches our table. It won't do me any good
to use the wrong encoding for the object.
Or I would need to know how to create my own file that I pass in to the
"GetEncoding" function which is what I'm guessing your doing with "using
JonSkeet.Ebcdic;" from your link.
Thanks.
> > I have read the "how to's" on MSDN including this one,http://msdn2.microsoft.com/en-us/library/36b93480.aspx, on reading/writing
> > files in C#, but haven't found something that I can put together that is
[quoted text clipped - 14 lines]
>
> Jon
Nicholas Paldino [.NET/C# MVP] - 20 Jun 2007 18:57 GMT
You could use Reflector to look into the encoding class, but if it is
making any calls to the underlying OS to handle the encoding (which in this
case, I imagine it is since you are requesting a code page) then you aren't
going to be able to figure it out.
However, you can do a comparison by cycling through the range of byte
values that are valid for the encoding, and seeing what the encoding spits
out for them. If they match your table, then use it.
If not, you can always create your own Encoding type, derived from
Encoding, so that it encodes/decodes the bytes the way you need it to.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> Jon,
>
[quoted text clipped - 45 lines]
>>
>> Jon
Jon Skeet [C# MVP] - 20 Jun 2007 19:43 GMT
> Thanks for the quick reply - I will look it over and try to work on it this
> week.
[quoted text clipped - 15 lines]
> "GetEncoding" function which is what I'm guessing your doing with "using
> JonSkeet.Ebcdic;" from your link.
The tables I use are taken from http://std.dkuug.dk/i18n/charmaps/ but
you can fairly easily use your own table if you rebuild my code. If you
look in the CharMapReader directory in the source.zip file you'll find
CharMapReader.cs which documents the file format (same as the site
linked above). You can put your own file in there, rebuild the
resources etc, and away you go.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too