Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/Elm/Kernel/Bytes.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ var _Bytes_read_bytes = F3(function(len, bytes, offset)

var _Bytes_read_string = F3(function(len, bytes, offset)
{
var string = '';
var string = [];
var end = offset + len;
for (; offset < end;)
{
var byte = bytes.getUint8(offset++);
string +=
string.push(
(byte < 128)
? String.fromCharCode(byte)
:
Expand All @@ -177,9 +177,10 @@ var _Bytes_read_string = F3(function(len, bytes, offset)
| bytes.getUint8(offset++) & 0x3F /* 0b00111111 */
) - 0x10000
, String.fromCharCode(Math.floor(byte / 0x400) + 0xD800, byte % 0x400 + 0xDC00)
);
)
);
}
return __Utils_Tuple2(offset, string);
return __Utils_Tuple2(offset, string.join(''));
});

var _Bytes_decodeFailure = F2(function() { throw 0; });