0

I run an api which returns multiple names, but sometimes it returns a \u0000 instead of its number. I want an output with only readable letters, so my question is how do I get from a list with strings which include \u0000 to a list which only has readable letters.

Input:

list_=['"fullname":"Arijanet Muri\u0107"', '"lastname":"Muri\u0107"'] 

Output:

list_=['"fullname":"Arijanet Murić"', '"lastname":"Murić"']
Mady Daby
  • 1,271
  • 6
  • 18
  • What kind of API is this? If it's JSON, then that's valid JSON encoding of a string and your JSON library should really take care of it. – Joachim Sauer Apr 25 '21 at 18:14
  • 1
    My guess is you are being fooled by the way you are displaying this information, and it's all working perfectly. The strings in your first statement do not actually contain the letters "u0107". That's just Python syntax convenience. They actually end with the "c with acute accent" character. – Tim Roberts Apr 25 '21 at 18:28

0 Answers0