Fix encoding range of UTF16

Ignore-this: 444de9225bcb43b6af883a9cdf5f352a
Found due to better QuickCheck properties

darcs-hash:20100214220255-a4fee-56b8388a1379774f3603405e144cdedead4a2edc
This commit is contained in:
Henning Guenther 2010-02-14 14:02:55 -08:00
parent 7b887abcb1
commit 87dbb737ed

View File

@ -79,4 +79,4 @@ instance Encoding UTF16 where
return (c:cs)
Right bom -> decode bom
decode enc = untilM sourceEmpty (decodeChar enc)
encodeable _ c = c <= '\x10FFFF'
encodeable _ c = (c > '\xDFFF' && c <= '\x10FFFF') || c < '\xD800'