mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Resynchronize the Shift_JIS converter after unrecognized sequences. Bug 690225, r=emk
This commit is contained in:
parent
26f43d1be2
commit
510fd7cf24
@ -169,7 +169,14 @@ NS_IMETHODIMP nsShiftJISToUnicode::Convert(
|
||||
case 1: // Index to table
|
||||
{
|
||||
PRUint8 off = sbIdx[*src];
|
||||
|
||||
// Error handling: in the case where the second octet is not in the
|
||||
// valid ranges 0x40-0x7E 0x80-0xFC, unconsume the invalid octet and
|
||||
// interpret it as the ASCII value. In the case where the second
|
||||
// octet is in the valid range but there is no mapping for the
|
||||
// 2-octet sequence, do not unconsume.
|
||||
if(0xFF == off) {
|
||||
src--;
|
||||
if (mErrBehavior == kOnError_Signal)
|
||||
goto error_invalidchar;
|
||||
*dest++ = SJIS_UNMAPPED;
|
||||
@ -191,7 +198,10 @@ NS_IMETHODIMP nsShiftJISToUnicode::Convert(
|
||||
case 2: // EUDC
|
||||
{
|
||||
PRUint8 off = sbIdx[*src];
|
||||
|
||||
// Error handling as in case 1
|
||||
if(0xFF == off) {
|
||||
src--;
|
||||
if (mErrBehavior == kOnError_Signal)
|
||||
goto error_invalidchar;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user