More than 5 years have passed since last update.
国立国会図書館のSPARQLデータベースにアクセスしたら、日本語はUTF-16で実体参照されていた。
しょうがないので変換する。
library(stringi);library(gsubfn)>stri_unescape_unicode(gsubfn("&#x|;",list("&#x"="\\u",";"=""),"夏目"))[1]"夏目"あとで以下の方法を鍵垢氏より教えてもらった。余計なパッケージを利用する必要がないので、こちらが吉。
>stri_unescape_unicode(stri_replace_all_fixed("夏目",c("&#x",";"),c("\\u",""),vectorize_all=FALSE))[1]"夏目"ちなみにjsonを指定すると、普通にUTF-8を返してきた。ばかやろう。
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
