Learn R Programming

Nippon (version 0.7.1)

sjis2utf8: Wrapper of iconv for Japanese encoding

Description

These functions are to encode Japanese characters from SJIS/JIS/EUC-JP to UTF-8.

Usage

sjis2utf8(x, CP932=TRUE)
eucjp2utf8(x)
jis2utf8(x)

Arguments

x

A character vecter

CP932

logical. If you like to use Shift-JIS instread of CP932, set CP932 = FALSE. The default is TRUE

Value

A character vector

Details

The major Japanese encoding systems are Shift-JIS (CP932), JIS (ISO-2022-JP), EUC-JP, and recently UTF-8. Exchanging Japanese strings data between the different platforms is often the cause of unreadable illegal characters. Since iconv could be the solution of this issues, these functions are written for the handy use of iconv, in partifular, when importing an old dataset or from the different platform.

See Also

iconv and localeToCharset.

Examples

Run this code
# NOT RUN {
x <- iconv(zenkaku$upper, from="UTF-8", to="CP932")
sjis2utf8(x)
# }

Run the code above in your browser using DataLab