codepoint {kanjistat}R Documentation

Convert between Unicode codepoint and kanji

Description

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"))
kanjiToCodepoint("\u51b7\u6696\u71b1")


[Package kanjistat version 0.9.1 Index]