I use curl
to get some URL response, it's JSON response and it contains unicode-escaped national characters like \u0144 (ń)
and \u00f3 (ó)
.
How can I convert them to UTF-8 or any other encoding to save into file?
I use curl
to get some URL response, it's JSON response and it contains unicode-escaped national characters like \u0144 (ń)
and \u00f3 (ó)
.
How can I convert them to UTF-8 or any other encoding to save into file?
I don't know which distribution you are using, but uni2ascii should be included.
$ sudo apt-get install uni2ascii
它只依赖于libc6,所以它是一个轻量级的解决方案(uni2ascii i386 4.18-2在Ubuntu上是55,0 kB)!
然后使用它:
$ echo 'Character 1: \u0144, Character 2: \u00f3' | ascii2uni -a U -q
Character 1: ń, Character 2: ó