is.CJK: Determining if a UTF-8 string is within the CJK Unicode...

Description Usage Arguments Value Author(s) Examples

View source: R/utf8latex.R

Description

is.CJK returns TRUE if a UTF-8 string is within the CJK Unicode ranges

Usage

1
is.CJK(utf8char)

Arguments

utf8char

UTF-8 string

Value

logic

Author(s)

Jose' Gama

Examples

1
2
3
4
5
fileIn<-system.file('extdata/TextCJK.txt', package='utf8latex')
# read a UTF-8 string from a file
x <- scan(file=fileIn,'character', fileEncoding='UTF-8')
# check if every character is within the CJK Unicode ranges
lapply(unlist(strsplit(x,'')), is.CJK)

Example output

Read 1 item
Warning message:
In scan(file = fileIn, "character", fileEncoding = "UTF-8") :
  invalid input found on input connection '/usr/local/lib/R/site-library/utf8latex/extdata/TextCJK.txt'
[[1]]
[1] FALSE

utf8latex documentation built on May 30, 2017, 4:30 a.m.

Related to is.CJK in utf8latex...