Fix logic for quoting special characters (#276)

* Fix logic for quoting special characters

* Remove has_ucs4 from condition

on systems with `sys.maxunicode <= 0xffff` the comparison
(u'\U00010000' <= ch < u'\U0010ffff') can't be true anyway I think
This commit is contained in:
Tina Müller (tinita) 2019-03-31 16:14:50 +02:00 committed by Tina Müller
parent 0f64cbfa54
commit 31f2279252
1 changed files with 1 additions and 1 deletions

View File

@ -706,7 +706,7 @@ class Emitter(object):
if not (ch == u'\n' or u'\x20' <= ch <= u'\x7E'):
if (ch == u'\x85' or u'\xA0' <= ch <= u'\uD7FF'
or u'\uE000' <= ch <= u'\uFFFD'
or ((not has_ucs4) or (u'\U00010000' <= ch < u'\U0010ffff'))) and ch != u'\uFEFF':
or (u'\U00010000' <= ch < u'\U0010ffff')) and ch != u'\uFEFF':
unicode_characters = True
if not self.allow_unicode:
special_characters = True