0

I am having a string which has following type of characters in encoded format: S\u00e3o Paulo

I want to convert it in normal form like São Paulo in python and then save it to database, so using which method of python i can convert it to normal form.

Do anyone know which method in python can be used for converting it to its normal form?

Dragonthoughts
  • 2,180
  • 8
  • 25
  • 28
krunal maniar
  • 31
  • 1
  • 4
  • Which python version you are using? – Arpit Svt Oct 31 '19 at 14:56
  • Possible duplicate of [byte string vs. unicode string. Python](https://stackoverflow.com/questions/10060411/byte-string-vs-unicode-string-python) – Arpit Svt Oct 31 '19 at 15:01
  • 2
    What do you mean, "normal form"? Do you have a string that literally contains a backslash, the letter `u`, and the hex digits `0`, `0`, `e` `3`, or are you looking at Python's (ASCII) string representation of the Unicode string? – chepner Oct 31 '19 at 16:27
  • The `\uxxxx` escape sequences is only recognized in a [string literal](https://docs.python.org/2.2/ref/strings.html) in Python 2 or 3.. So `U'S\u00e3o Paulo'` or `u"S\u00e3o Paulo"` return `'São Paulo'`. – JosefZ May 31 '20 at 07:52

0 Answers0