Use UTF-16 Encoder / Decoder without a complicated workflow.
Encode text to UTF-16 code units and decode UTF-16 values back into readable text. This registration is prepared for a browser-side JavaScript UI, so no Python/API processing is required when the UI is implemented.