Closed
Description
The PostReadControl decodes the attribute values in ISO8859-1.
from ldap.controls.readentry import PostReadControl
[PostReadControl(True, ['entryUUID', 'entryCSN', 'displayName'])]
using this control result in:
>>> ctrls
<ldap.controls.readentry.PostReadControl object at 0x7f10d1e738d0>
>>> ctrls.entry
{'entryUUID': ['5d96cc2c-8e13-103a-8ca5-2f74868e0e44'], 'displayName': ['Ã\x84dministrator3'], 'entryCSN': ['20201122182218.677180Z#000000#000#000000']}
>>> print(ctrls.entry['displayName'][0].encode('latin-1').decode('UTF-8'))
Ädministrator3
I would have expected the attributes to be bytes
, not str(/unicode)
. Or at least take the correct encoding from the LDAP server schema.
Metadata
Metadata
Assignees
Labels
No labels