Merge

Tue, 02 Jun 2015 17:59:28 +0530

author
sundar
date
Tue, 02 Jun 2015 17:59:28 +0530
changeset 1389
24cb54d0bfa2
parent 1388
d03088193a17
parent 1386
e5b03cc6f269
child 1390
556876366259

Merge

     1.1 --- a/src/jdk/nashorn/internal/runtime/Source.java	Tue Jun 02 10:40:19 2015 +0200
     1.2 +++ b/src/jdk/nashorn/internal/runtime/Source.java	Tue Jun 02 17:59:28 2015 +0530
     1.3 @@ -910,14 +910,16 @@
     1.4              start = 2;
     1.5              cs = StandardCharsets.UTF_16BE;
     1.6          } else if (bytes.length > 1 && bytes[0] == (byte) 0xFF && bytes[1] == (byte) 0xFE) {
     1.7 -            start = 2;
     1.8 -            cs = StandardCharsets.UTF_16LE;
     1.9 +            if (bytes.length > 3 && bytes[2] == 0 && bytes[3] == 0) {
    1.10 +                start = 4;
    1.11 +                cs = Charset.forName("UTF-32LE");
    1.12 +            } else {
    1.13 +                start = 2;
    1.14 +                cs = StandardCharsets.UTF_16LE;
    1.15 +            }
    1.16          } else if (bytes.length > 2 && bytes[0] == (byte) 0xEF && bytes[1] == (byte) 0xBB && bytes[2] == (byte) 0xBF) {
    1.17              start = 3;
    1.18              cs = StandardCharsets.UTF_8;
    1.19 -        } else if (bytes.length > 3 && bytes[0] == (byte) 0xFF && bytes[1] == (byte) 0xFE && bytes[2] == 0 && bytes[3] == 0) {
    1.20 -            start = 4;
    1.21 -            cs = Charset.forName("UTF-32LE");
    1.22          } else if (bytes.length > 3 && bytes[0] == 0 && bytes[1] == 0 && bytes[2] == (byte) 0xFE && bytes[3] == (byte) 0xFF) {
    1.23              start = 4;
    1.24              cs = Charset.forName("UTF-32BE");

mercurial