D
D
Dunno20182019-10-29 12:39:29
XML
Dunno2018, 2019-10-29 12:39:29

How to decode text from unicode in xml file?

Hello.
English is all right. Russian looks like this:
5db8083c6badc518405663.png
The encoding is UTF-8

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey c0re, 2019-10-29
@Dunno2018

Dunno2018 ,
Cyrillic and should not be displayed, this is NOT UTF-8 , this is Unicode, as if these are different things.
because there is no source data, then, as an example, an online decoder:
https://unicode-table.com/en/tools/decoder/
in order to bring the text into normal form and decode it is necessary to replace everything
;&#xwith \u0 and \u0&#x the resulting text plug into the decoder. UPD: Here is an example of decoding the first string in Python

a = u'\u041a\u0432\u0430\u0440\u0442\u0438\u0440\u044b \u043D\u0430'
print a.encode('UTF-8')

result:
Wrote a one-line transcoder in bash + python
Convert text to xml from unicode to utf-8
PS: seems to work :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question