0

All cyrillic symbols which I get in json body are encoded in the folliwing way inside network inspector:

{
      "Магазин": "dd29a406-1484-11ed-bb9a-0050569d338f",
      "�стория": "d07df264-d546-4292-a8df-3d8c5253aed2",
      "РџРѕСЂСЏРґРѕРє": 965,
      "�сторияПросмотрена": false,
      "УРЛПревью": "https://i.ibb.co/WGhVNhv/image.jpg",
      "�мя�стории": "Telegram и Вконтакте_новый формат",
      "ДатаОкончания": "2022-12-31T00:00:00"
    }

I managed to find out that this hieroglyphs appear when we encode UTF-8 with the help of Windows-1251. I tried to change the encoding inside android studio, but did not get the result. Any suggestions?

  • `I tried to change the encoding inside android studio` ? I would think you would do that with code for your Android app when you get the json body. And why network inspector? Why not in your app at receiving the json? Also show the cyrillic text. – blackapps Sep 01 '22 at 11:00
  • 1
    You face a [mojibake](https://en.wikipedia.org/wiki/Mojibake) case (*example in Python for its universal intelligibility*): `'Магазин'.encode( 'utf-8').decode( 'cp1251')` returns `'Магазин'` and vice versa: `"Магазин".encode( 'cp1251').decode( 'utf-8')` returns `'Магазин'` (the 1st line of your `json`) or `'ДатаОкончания'.encode( 'cp1251').decode( 'utf-8')` returns `'ДатаОкончания'` (the last `json` line). – JosefZ Sep 01 '22 at 17:38

0 Answers0