Correct REPLACEMENT CHARACTER's code point to FFFD (#1471)
This commit is contained in:
parent
1683bb2c93
commit
b225593d6b
|
@ -60,10 +60,10 @@ try:
|
||||||
yield 0x10000 + (high_surrogate - 0xD800) * 0x400 + (cp - 0xDC00)
|
yield 0x10000 + (high_surrogate - 0xD800) * 0x400 + (cp - 0xDC00)
|
||||||
high_surrogate = None
|
high_surrogate = None
|
||||||
else:
|
else:
|
||||||
yield 0xFFFC
|
yield 0xFFFD
|
||||||
else:
|
else:
|
||||||
if high_surrogate:
|
if high_surrogate:
|
||||||
yield 0xFFFC
|
yield 0xFFFD
|
||||||
high_surrogate = None
|
high_surrogate = None
|
||||||
if 0xD800 <= cp <= 0xDBFF:
|
if 0xD800 <= cp <= 0xDBFF:
|
||||||
high_surrogate = cp
|
high_surrogate = cp
|
||||||
|
@ -71,7 +71,7 @@ try:
|
||||||
yield cp
|
yield cp
|
||||||
high_surrogate = None
|
high_surrogate = None
|
||||||
if high_surrogate:
|
if high_surrogate:
|
||||||
yield 0xFFFC
|
yield 0xFFFD
|
||||||
|
|
||||||
except NameError:
|
except NameError:
|
||||||
unichr = chr
|
unichr = chr
|
||||||
|
|
Loading…
Reference in New Issue