0

I am creating a custom build system. The third-party app returns result text with the following symbols:

  • \xd0\x9a\xd0\xb0\xd0\xb6\xd0\xb5\xd1\x82\xd1\x81\xd1\x8f
  • \u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439
  • \u00a0\u00a0

Is there any way to get the result as human-readable?

I tried to play with env and encoding options, but it didn't help.

JosefZ
  • 28,460
  • 5
  • 44
  • 83
LA_
  • 19,823
  • 58
  • 172
  • 308
  • 1
    The first result is gibberish - just random characters. The second one is Cyrillic - `английский`, which apparently means "English" in Russian. The third one is just `áá`. The codes themselves are Python escape codes for hexadecimal numbers, if you want to convert them to decimal and look up each one individually. As far as fixing it, you'll have to figure out why your third-party app is doing it. Sublime is just printing the information it gets. – MattDMo Jun 27 '20 at 21:08
  • @MattDMo, thanks. Looks like I can not fix it with `env` and `encoding` options, but `sed` and `iconv` commands should help. – LA_ Jun 29 '20 at 19:42
  • @MattDMo `\u00a0\u00a0` are two _No-Break Spaces_ and the first result is Russian: `'\xd0\x9a\xd0\xb0\xd0\xb6\xd0\xb5\xd1\x82\xd1\x81\xd1\x8f'.encode( 'latin1').decode('utf-8')` returns `'Кажется'` in Python… – JosefZ Feb 10 '21 at 17:17

0 Answers0