× 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.



If its just a EBCDIC DBCS 5026 text file to be converted to Shift-JIS,
default Java APIs should be fine.

//
import java.io.*;
//
public class CP930toSJIS {
    public static void main(String args[]) {
        int c;
        try {
            FileInputStream fin = new FileInputStream(args[0]);
            InputStreamReader isr = new InputStreamReader(fin, "Cp930");
            FileOutputStream fout = new
FileOutputStream(args[0]+".SJIS");
            OutputStreamWriter osw = new OutputStreamWriter(fout,
"SJIS");
            while ((c = isr.read()) > 0) {
                osw.write(c);
            }
            osw.close();
        } catch (IOException e) {
            System.out.println(e.getMessage());
        }
    }
}

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Joe Pluta
Sent: Wednesday, January 21, 2004 2:22 AM
To: 'Java Programming on and around the iSeries / AS400'
Subject: DBCS to Shift-JIS


Is there an easy way to take EBCDIC DBCS data (CCSID 5026) and convert
it to ASCII Shift-JIS (CCSID 943)?  Will the AS400Text object help me do
this?  Let's say I have an array of bytes with the EBCDIC data in it.
What's the easiest way to convert this to a String containing Shift-JIS
data?

byte[] ccsid5026 = new byte[]
  { x'0e', x'45', x'a0', x'47', x'9a', '45', x'f9', x'0f' };

And I want to get:

String jisdata;

With the following hex values: x'8d87', x'8cbe', x'9774'

Joe

_______________________________________________
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.



This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.


This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.