IBM Support

The volume of EBCDIC Kanji (DBCS) codes in Code Page 1390 which are not defined in Code Page 930

Question & Answer


Question

  How to check the volume of EBCDIC Kanji (DBCS) codes in Code Page 1390 which are not defined in Code Page 930 ?

Cause

  Referring to the following link, we see Code Page 1390 includes SBCS Code Page 8482 + DBCS Code Page 16684 in addition to Code Page 930, but we have no public character code table of Code Page 8482 and 16684.
* Supported character sets
    https://www-01.ibm.com/support/docview.wss?uid=swg27021866
    IBM-930
    Japanese (Katakana) Extended with 4370 UDC.
    SBCS:IBM-290 + DBCS:IBM-300
    SBCS-CCSID:290 + DBCS-CCSID:300
    IBM-1390
    Japanese (Katakana) Extended with euro and UDC 6205.
    SBCS:IBM-290 + DBCS:IBM-300
    SBCS-CCSID:8482 + DBCS-CCSID:16684

Answer

  In a case like this, the getBytes() method usage on IBM Java is an option to check the valid Kanji (DBCS) character codes conversion between IBM Code Page 1390 and 930 on IBM Java because IBM Java supports the character code conversion in IBM Code Page 1390 and 930.
  For example, the following EBCDIC Kanji (DBCS) code '0x0E, 0x4141, 0x4242, 0x4343, 0x0F' is converted into '0x0E41410F, 0x6F, 0x0E43430F' ('α', '?', '」'), and 0x6F ('?') is used as the replacement character when the proper character code point is not defined in the specific code page on IBM Java 8.
* Sample Java code for EBCDIC Kanji code "0x0E, 0x4141, 0x4242, 0x4343, 0x0F"
        byte[] byteIBM      = new byte[] { (byte)0x0E, (byte)0x41, (byte)0x41, (byte)0x42, (byte)0x42, (byte)0x43, (byte)0x43, (byte)0x0F };
        String strCp1390  = new String( byteIBM, "Cp1390" );
        String strCp930   = new String( byteIBM, "Cp930" );
        System.out.print( " ==> \"" + strCp1390 + "\"  Cp1390 : 0x" );
        for( byte aByte : strCp1390.getBytes( "Cp1390" ) ) { System.out.printf( "%02X", aByte ); }
        System.out.print( " ==> \"" + strCp930  + "\"  Cp930 : 0x" );
        for( byte aByte : strCp1390.getBytes( "Cp930" ) )  { System.out.printf( "%02X", aByte ); }
  Therefore, per running the following Java program, we can see 10416 character codes are much more defined in IBM Code Page 1390 rather than ones in IBM Code Page 930.
$ java ConvCp930 | grep -v "Cp1390 : 0x6F" | grep "Cp930 : 0x6F" | wc -l
   10416
$ cat ConvCp930.java
// ConvCp930.java
import java.sql.*;
public class ConvCp930
{
    public static void main( String[] args ) throws Exception
    {
        byte[] byteIBM    = new byte[] { (byte)0x0e, (byte)0x41, (byte)0x41, (byte)0x0f };
        byte[] byteCp1390 = new byte[4];
        byte[] byteCp930  = new byte[4];
        String encDefault = new String( System.getProperty( "file.encoding" ) );
        for( int i = 0x40; i <= 0xff; i++ ) {
            byteIBM[1] = (byte) i;
            for( int j = 0x40; j <= 0xff; j++ ) {
                byteIBM[2] = (byte) j;
                String strCp1390  = new String( byteIBM, "Cp1390" );
                String strCp930   = new String( byteIBM, "Cp930" );
                String strDefault = new String( strCp1390.getBytes() );
                System.out.print( "IBM code : 0x" );
                for( byte aByte : byteIBM ) { System.out.printf( "%02X", aByte ); }
                System.out.print( " ==> \"" + strCp1390 + "\"  Cp1390 : 0x" );
                for( byte aByte : byteCp1390 = strCp1390.getBytes( "Cp1390" ) ) { System.out.printf( "%02X", aByte ); }
                System.out.print( " ==> \"" + strCp930  + "\"  Cp930 : 0x" );
                for( byte aByte : byteCp930  = strCp1390.getBytes( "Cp930" ) )  { System.out.printf( "%02X", aByte ); }
                System.out.print( "  ( \"" + strDefault + "\"  " + encDefault + " : 0x" );
                for( byte aByte : strDefault.getBytes() )  { System.out.printf( "%02X", aByte ); }
                if( strCp1390.equals( strCp930 ) )
                    System.out.println( " )" );
                else
                    System.out.println( " *NOT MATCH* )" );
            }
        }
    }
}

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
11 April 2019

UID

ibm10880681