OSDN Git Service

Add NIOS2 support. Code from SourceyG++.
[pf3gnuchains/gcc-fork.git] / libjava / testsuite / libjava.lang / pr27171.java
1 public class pr27171 {
2
3         public static void main(String[] args) throws Throwable {
4           // Isolated low surrogate.
5           char x = 56478;  // 0xdc9e
6           String xs = new String(new char[] { x });
7           // Note that we fix a result for our implementation; but
8           // the JDK does something else.
9           System.out.println(xs.getBytes("UTF-8").length);
10
11           // isolated high surrogate -- at end of input stream
12           char y = 0xdaee;
13           String ys = new String(new char[] { y });
14           // Note that we fix a result for our implementation; but
15           // the JDK does something else.
16           System.out.println(ys.getBytes("UTF-8").length);
17         }
18 }
19