- Notifications
You must be signed in to change notification settings - Fork124
Open
Description
In the case of an invalid array input when converting to Unicode, currently encoding.js output the invalid bytes as normal question marks (char code 63), so I can't remove invalid characters from the result without accidentally remove valid question marks. Can you ask an option to remove invalid characters after decoding, or at least use a special character instead of question mark as a placeholder for invalid result characters?
Sample code:
const targetBytes = encoding.convert( '??', { to: 'SJIS', type: 'array', });const result = encoding.convert(targetBytes.slice(0, 2), { to: 'UNICODE', from: 'SJIS', type: 'string',});Result:??. Both characters are? even though the last one should be an invalid character.
Metadata
Metadata
Assignees
Labels
No labels