Skip to content

PostReadControl decodes values in ISO8859-1 #399

@spaceone

Description

@spaceone

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy