We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3565117 commit d4a6c50Copy full SHA for d4a6c50
truffle/src/com.oracle.truffle.api.strings/src/com/oracle/truffle/api/strings/TruffleString.java
@@ -6909,13 +6909,13 @@ static String doUTF16(TruffleString a,
6909
if (a.isEmpty()) {
6910
return "";
6911
}
6912
- TruffleString cur = a.next;
6913
- if (cur != null) {
+ TruffleString cur;
+ if (a.isCompatibleToIntl(Encoding.UTF_16) || (cur = a.next) == null) {
6914
+ cur = a;
6915
+ } else {
6916
while (cur != a && !cur.isCompatibleToIntl(Encoding.UTF_16)) {
6917
cur = cur.next;
6918
- } else {
- cur = a;
6919
6920
Encoding encodingA = Encoding.get(cur.encoding());
6921
final AbstractTruffleString utf16String;
0 commit comments