代码页或阿拉伯字符

时间:2014-09-29 19:27:02

标签: java eclipse codepages

考虑以下代码:

 public class lamAlifTestClass {
    public static void main(String[] args) {
       String a = "لا";
       String b = "a";

       byte[] y = a.getBytes(); // -28 & -57
       byte[] z = b.getBytes(); // 97


       System.out.println("Special character length: " + y.length);
       System.out.println("Normal character length: " + z.length);

    }
 }

使用eclipse的默认代码页Cp1046,特殊字符占用2个字节。 是否有一个代码页,此字符只占用1个字节? 这个角色叫做lam-alif。

我如何让eclipse / java使用这个代码页,其中字符只占用1个字节? 我试图更改文件属性中的代码页,但它有效吗?

http://www.fileformat.info/info/charset/x-IBM1046/list.htm

0 个答案:

没有答案
相关问题