You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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:
Result:
??
. Both characters are?
even though the last one should be an invalid character.The text was updated successfully, but these errors were encountered: