× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



>I think I am having a problem with ASCII to EBCDIC conversions.  Here is
>what I know:  I am storing an encrypted file on the IFS.  The file comes
>from a vendor and they are running a PC package.  The file is encoded in
>ASCII. . .

What Java methods are you using to read the data?

If you are reading in binary, into byte streams, this should be no problem.

If you are reading anything involved with encryption using "text" methods
(methods that translate to Unicode), and using the default code page, you
will probably run into problems.

There is no such thing as ASCII in the sense that it is one thing.  There
are several ASCIIs.  It turns out that different JVMs pick different
"ASCII" encodings as their default.

Whether this is just the encryption key or the data proper may not matter
so much.  What matters is which characters are present in some relevant
stream.

What is probably happening is that the PC-based stuff is read and written
using (in the US) Microsoft's 1252 code page.  On OS/400, you should be
using ISO 8859-1 by default.  Both are a superset of "US ASCII".  These
code pages are nearly identical, but not quite identical.

Depending on what's going on, therefore, they will not be translated to
Unicode in the same manner (if you are so translating them, implicitly or
otherwise).  Since we're talking encryption, even a single character or two
coming out differently can have vast repercussions.

Look into "properties".  I think (look this up to be sure) you need cp819
for ISO 8859-1 and cp1252 for MS 1252.  Something like
-Dfile.encoding=cp1252 added to the QSH command line.

Or, it might be EBCDIC code pages somehow involved, too.  But, my first
guess would be a mismatch between the OS/400 default of ISO 8859-1 and
Microsoft's MS 1252.


Larry W. Loen  -   Senior Linux, Java, and iSeries Performance Analyst
                          Dept HP4, Rochester MN




As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.