Skip to contents

Given codepoints cp, the function codepointToKanji transforms to UTF-8, which will typically show as the actual character the codepoints stands for. Vice versa, given (UTF-8 encoded) kanjis kan, the function kanjiToCodepoint transforms to unicode codepoints.

Usage

codepointToKanji(cp, concat = FALSE)

kanjiToCodepoint(kan, character = FALSE)

Arguments

cp

a vector of character strings or objects of class hexmode, representing hexadecimal numbers.

concat

logical. Shall the returned characters be concatenated?

kan

a vector of kanjis (strings of length 1) or a single string of length >= 1 of kanjis.

character

logical. Shall the returned codepoints be of class "character" or hexmode.

Value

For codepointToKanji a character vector of kanji. For kanjiToCodepoint a vector of hexadecimal numbers (class hexmode).

Examples

codepointToKanji(c("51b7", "6696", "71b1"))
#> [1] "冷" "暖" "熱"
kanjiToCodepoint("冷暖熱")
#> [1] "51b7" "6696" "71b1"