Skip to content

Surrogates Error Decompressing UTF-16 #16

@wolfxvi

Description

@wolfxvi

Im trying to decompress an api response that is compressed in utf-16 but when i try it i get the following error "UnicodeEncodeError: 'utf-8' codec can't encode character '\udc00' in position 0: surrogates not allowed" (note that the character is not always the same). I researched it and i found that the character is probably an emoji. I tryied to encode and decode the string before the decpmpress with surrogateescape, or surrogatepass with no luck.. Any idea how to fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions