class PrintGB2312_1
{
public static void main(String args[])
{
byte bArry[]=new byte[2];
int iIndex=0;
int iCount=0;
for(int i=16;i<=55;i++)
{
for(int j=1;j<=94;j++)
{
if(i==55&&j>99) break;
bArry[0]=(byte) (i+160);
bArry[1]=(byte) (j+160);
String sTmp=new String(bArry);
System.out.print(i+(j<10 ? "0" + j :"" + j) + sTmp + "");
iCount++;
if(iCount%8==0) System.out.println();
}
}
}
}
本文分享了一个用于打印GB2312字符集的Java程序示例。通过循环遍历GB2312编码范围内的字节,构造字符串并输出,此程序能够帮助理解GB2312编码的具体内容。
1万+





