1)字符串中的高低代理字符顺序是否固定?我可以依靠它吗?在 Windows 上进行实验,highSurrogate 首先进入 String(在 String.charAt(int index) 方面的较低索引处)。在任何平台(Linux 等)上总是如此吗?这是否记录在案?
int[] codePoint = { 0x1F71D };
String s = new String(codePoint, 0, 1);
System.out.println(s.length()); // 2
System.out.println(s); //
System.out.println((int) Character.highSurrogate(codePoint[0]));
System.out.println((int) Character.lowSurrogate(codePoint[0]));
System.out.println((int) s.charAt(0)); // highSurrogate
System.out.println((int) s.charAt(1)); // lowSurrogate
2)此外,我有点困惑:高/低代理代码单元顺序和字节序之间是否存在关联?我想没有任何关联,这两个概念是正交的?