-
-
Notifications
You must be signed in to change notification settings - Fork 599
Labels
builtinsPRs and Issues related to builtins/intrinsicsPRs and Issues related to builtins/intrinsicsgood first issueGood for newcomersGood for newcomers
Description
Boa:
>> new TextDecoder().decode(Uint8Array.of(0xef, 0xbb, 0xbf)).length
1
>> new TextDecoder('utf-16le').decode(Uint8Array.of(0xff, 0xfe)).length
1
>> new TextDecoder('utf-16be').decode(Uint8Array.of(0xfe, 0xff)).length
1
>> new TextDecoder('utf-8', { ignoreBOM: true }).decode(Uint8Array.of(0xef, 0xbb, 0xbf)).length
1
>> new TextDecoder('utf-16le', { ignoreBOM: true }).decode(Uint8Array.of(0xff, 0xfe)).length
1
>> new TextDecoder('utf-16be', { ignoreBOM: true }).decode(Uint8Array.of(0xfe, 0xff)).length
1
>> new TextDecoder('utf-8', { ignoreBOM: false }).decode(Uint8Array.of(0xef, 0xbb, 0xbf)).length
1
>> new TextDecoder('utf-16le', { ignoreBOM: false }).decode(Uint8Array.of(0xff, 0xfe)).length
1
>> new TextDecoder('utf-16be', { ignoreBOM: false }).decode(Uint8Array.of(0xfe, 0xff)).length
1Correct behavior:
> new TextDecoder().decode(Uint8Array.of(0xef, 0xbb, 0xbf)).length
0
> new TextDecoder('utf-16le').decode(Uint8Array.of(0xff, 0xfe)).length
0
> new TextDecoder('utf-16be').decode(Uint8Array.of(0xfe, 0xff)).length
0
> new TextDecoder('utf-8', { ignoreBOM: true }).decode(Uint8Array.of(0xef, 0xbb, 0xbf)).length
1
> new TextDecoder('utf-16le', { ignoreBOM: true }).decode(Uint8Array.of(0xff, 0xfe)).length
1
> new TextDecoder('utf-16be', { ignoreBOM: true }).decode(Uint8Array.of(0xfe, 0xff)).length
1
> new TextDecoder('utf-8', { ignoreBOM: false }).decode(Uint8Array.of(0xef, 0xbb, 0xbf)).length
0
> new TextDecoder('utf-16le', { ignoreBOM: false }).decode(Uint8Array.of(0xff, 0xfe)).length
0
> new TextDecoder('utf-16be', { ignoreBOM: false }).decode(Uint8Array.of(0xfe, 0xff)).length
0Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
builtinsPRs and Issues related to builtins/intrinsicsPRs and Issues related to builtins/intrinsicsgood first issueGood for newcomersGood for newcomers