Convert from \ unnnn to letters

I have a file with letters stored as

\u0410\u0411\u0426 

I want to convert them into something readable, for example, \u0410\u0411\u0426 means

but I don’t know anything about why A is stored as \u0410 or why is stored as \u0411 . how can i do the conversion between the two?

+4
source share
2 answers
 $ echo -e '\u0410\u0411\u0426'  $ printf '\u0410\u0411\u0426'  $ python3 -c 'print("\u0410\u0411\u0426")'  $ echo '\u0410\u0411\u0426' | ascii2uni -qaU  
+3
source
 #irb -E binary ruby-1.9.3-p0 :001 > s="\u0410\u0411\u0426" => "\u0410\u0411\u0426" #irb -E utf-8 ruby-1.9.3-p0 :001 > s="\u0410\u0411\u0426" => "" 

you need to read something about character encoding, unicode and utf-8

+1
source

Source: https://habr.com/ru/post/1387379/


All Articles