How can I convert a unicode string into string literals in Python 2.7?

Viewed 1587

Python2.7: I would like to do something unusual. Most people want to convert string literals to more human-readable strings. I would like to convert the following list of unicode strings into their literal forms:

  • hallöchen
  • Straße
  • Gemüse
  • freø̯̯nt

to their codepoint forms that look something like this:

\u3023\u2344

You'll notice that freø̯̯nt has two inverted breves below the ø. I would like to convert especially that word into its literal form, such that I can use REGEX to remove the extra breve.

I am not sure what the terminology is for these things—please correct me if I am mistaken.

2 Answers
Related