| Index: runtime/vm/object.cc
|
| ===================================================================
|
| --- runtime/vm/object.cc (revision 14802)
|
| +++ runtime/vm/object.cc (working copy)
|
| @@ -10077,12 +10077,12 @@
|
| Heap::Space space) {
|
| Utf8::Type type;
|
| intptr_t len = Utf8::CodePointCount(utf8_array, array_len, &type);
|
| - if (type == Utf8::kAscii) {
|
| + if (type == Utf8::kISOLatin1) {
|
| const String& strobj = String::Handle(OneByteString::New(len, space));
|
| if (len > 0) {
|
| NoGCScope no_gc;
|
| - Utf8::DecodeToAscii(utf8_array, array_len,
|
| - OneByteString::CharAddr(strobj, 0), len);
|
| + Utf8::DecodeToISOLatin1(utf8_array, array_len,
|
| + OneByteString::CharAddr(strobj, 0), len);
|
| }
|
| return strobj.raw();
|
| }
|
| @@ -10100,7 +10100,7 @@
|
| Heap::Space space) {
|
| bool is_one_byte_string = true;
|
| for (intptr_t i = 0; i < array_len; ++i) {
|
| - if (utf16_array[i] > 0x7F) {
|
| + if (utf16_array[i] > 0xFF) {
|
| is_one_byte_string = false;
|
| break;
|
| }
|
| @@ -10118,7 +10118,7 @@
|
| bool is_one_byte_string = true;
|
| intptr_t utf16_len = array_len;
|
| for (intptr_t i = 0; i < array_len; ++i) {
|
| - if (utf32_array[i] > 0x7F) {
|
| + if (utf32_array[i] > 0xFF) {
|
| is_one_byte_string = false;
|
| }
|
| if (utf32_array[i] > 0xFFFF) {
|
| @@ -10199,7 +10199,7 @@
|
| if (dst.IsOneByteString()) {
|
| NoGCScope no_gc;
|
| for (intptr_t i = 0; i < array_len; ++i) {
|
| - ASSERT(utf16_array[i] <= 0x7F);
|
| + ASSERT(utf16_array[i] <= 0xFF);
|
| *OneByteString::CharAddr(dst, i + dst_offset) = utf16_array[i];
|
| }
|
| } else {
|
| @@ -10354,7 +10354,7 @@
|
| intptr_t char_size = str.CharSize();
|
| if (char_size == kTwoByteChar) {
|
| for (intptr_t i = begin_index; i < begin_index + length; ++i) {
|
| - if (str.CharAt(i) > 0x7F) {
|
| + if (str.CharAt(i) > 0xFF) {
|
| is_one_byte_string = false;
|
| break;
|
| }
|
| @@ -10413,10 +10413,10 @@
|
| if (!has_mapping) {
|
| return str.raw();
|
| }
|
| - if (dst_max <= 0x7F) {
|
| + if (dst_max <= 0xFF) {
|
| return OneByteString::Transform(mapping, str, space);
|
| }
|
| - ASSERT(dst_max > 0x7F);
|
| + ASSERT(dst_max > 0xFF);
|
| return TwoByteString::Transform(mapping, str, space);
|
| }
|
|
|
| @@ -10564,7 +10564,7 @@
|
| Heap::Space space) {
|
| const String& result =String::Handle(OneByteString::New(len, space));
|
| for (intptr_t i = 0; i < len; ++i) {
|
| - ASSERT(characters[i] <= 0x7F);
|
| + ASSERT(characters[i] <= 0xFF);
|
| *CharAddr(result, i) = characters[i];
|
| }
|
| return OneByteString::raw(result);
|
| @@ -10576,7 +10576,7 @@
|
| Heap::Space space) {
|
| const String& result = String::Handle(OneByteString::New(len, space));
|
| for (intptr_t i = 0; i < len; ++i) {
|
| - ASSERT(characters[i] <= 0x7F);
|
| + ASSERT(characters[i] <= 0xFF);
|
| *CharAddr(result, i) = characters[i];
|
| }
|
| return OneByteString::raw(result);
|
| @@ -10630,7 +10630,7 @@
|
| const String& result = String::Handle(OneByteString::New(len, space));
|
| for (intptr_t i = 0; i < len; ++i) {
|
| int32_t ch = mapping(str.CharAt(i));
|
| - ASSERT(ch >= 0 && ch <= 0x7F);
|
| + ASSERT(ch >= 0 && ch <= 0xFF);
|
| *CharAddr(result, i) = ch;
|
| }
|
| return OneByteString::raw(result);
|
|
|