Encoding 문제 #

utf-8, unicode, 한글

Sys.getlocale(category = "LC_ALL")
Sys.setlocale("LC_COLLATE", "C")
Sys.setlocale("LC_COLLATE", "Korean_Korea.949")


iconv('pretty\u003D\u003Ebig', "UTF-8", "CP949")
iconv('pretty\u003D\u003Ebig', "UTF-8", "ASCII")

UTF-8 to Unicode #

library("Unicode")
utf8_to_unicode <- function(utf8_string){
    for(i in 1:length(utf8_string)){
        utf8_string[i] <- paste(as.character(utf8ToInt(utf8_string[i])), collapse=",")
    }
    return (utf8_string)
}