How to Encode String of Raw UTF-8 into Unicode?

H

Henry Chang

Hi everyone,

Suppose I start out with a raw string of utf-8 code points.

raw_string = "68656E727963"

I can coerce it into proper unicode format by slicing out two
characters at a time.

unicode_string = u"\x68\x65\x6E\x72\x79\x63"

My question: is there an existing function that can do this (without
having to manually slicing the raw text string)?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top