Avatar ·

So deaktivieren Sie die Ersetzung des kyrillischen Alphabets durch \ uxxxx in Zeilen bei der Konvertierung in JSON

📁 Python, Hilfe, Beispiel

Wenn Sie versuchen, die JSON-Ausgabe mit json.dumps() zu formatieren, werden russische Symbole nicht mehr angezeigt. So etwas wie "beliebiges Feld, z.B. Adresse" : "\ u04443 \ u043b \ u0438 \ u04430 \ u041c \ u0430, usw."

Ich habe json.dumps().encode("utf-8") und codecs.decode() ausprobiert - nichts hilft.

   def   load_data  ( filepath ):  with   open  (filepath,  'r' , encoding= 'utf-8' )  as  fh: data = json.load(fh)  # Load data from file into data variable   return  data  def   pretty_print_json  ( data ): inf = json.dumps(data, sort_keys= False )