[Python] how to get generate utf-8 encoding from unicode codepoints in Private Use Area planes...

Discussão em 'Python' iniciado por Stack, Fevereiro 25, 2025.

  1. Stack

    Stack Membro Participativo

    How can I generate the hex codes of a utf-8 encoding from unicode codepoints in Private Use Area (PUA) planes?

    In other planes, such as BMP, this can be done easily with chr():

    for instance:

    chr(107).encode('utf-8')


    or for emojis, beyond the BMP, it also works:

    chr(128558).encode('utf-8')


    However, chr() cannot work in PUA planes

    Thanks

    Continue reading...

Compartilhe esta Página