mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #28321: Fixed writing non-BMP characters with binary format in plistlib.
This commit is contained in:
commit
db8d6265fa
3 changed files with 10 additions and 1 deletions
|
@ -918,7 +918,7 @@ class _BinaryPlistWriter (object):
|
|||
self._write_size(0x50, len(value))
|
||||
except UnicodeEncodeError:
|
||||
t = value.encode('utf-16be')
|
||||
self._write_size(0x60, len(value))
|
||||
self._write_size(0x60, len(t) // 2)
|
||||
|
||||
self._fp.write(t)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue