获取操作系统的代码:
//获取操作系统名称
tringoperation=System.getProperty("os.name");
//转成大写
peration=operation.toUpperCase(Locale.ENGLISH);
//判断是否是AIX的
f(operation.indexOf("AIX")!=-1)
{
//是AIX
}
else
{
//不是AIX
}
如果是AIX,在写文件前,多加一行代码:
str=newString(str.getBytes("GBK"),"ISO8859_1");
把GBK格式的转换成ISO8859_1
如果是AIX,在读取文件以后,需要把读取出的一行数据,进行转换:
str=newString(str.getBytes("ISO8859_1"),"GBK");
把ISO8859_1格式的转换成GBK
//获取操作系统名称
tringoperation=System.getProperty("os.name");
//转成大写
peration=operation.toUpperCase(Locale.ENGLISH);
//判断是否是AIX的
f(operation.indexOf("AIX")!=-1)
{
//是AIX
}
else
{
//不是AIX
}
如果是AIX,在写文件前,多加一行代码:
str=newString(str.getBytes("GBK"),"ISO8859_1");
把GBK格式的转换成ISO8859_1
如果是AIX,在读取文件以后,需要把读取出的一行数据,进行转换:
str=newString(str.getBytes("ISO8859_1"),"GBK");
把ISO8859_1格式的转换成GBK