hex2ucp | R Documentation |
hex2ucp()
, int2ucp()
, name2ucp()
, and str2ucp()
return
Unicode code points as character vectors. is_ucp()
returns
TRUE
if a valid Unicode code point.
hex2ucp(x) int2ucp(x) str2ucp(x) name2ucp(x, type = c("exact", "grep"), ...) is_ucp(x) block2ucp(x, omit_unnamed = TRUE) range2ucp(x, omit_unnamed = TRUE)
x |
R objects coercible to the respective Unicode character data types.
See |
type |
one of |
... |
arguments to be passed to |
omit_unnamed |
Omit control codes or unassigned code points |
hex2ucp(x)
is a wrapper for as.character(Unicode::as.u_char(x))
.
int2ucp
is a wrapper for as.character(Unicode::as.u_char(as.integer(x)))
.
str2ucp(x)
is a wrapper for as.character(Unicode::as.u_char(utf8ToInt(x)))
.
name2ucp(x)
is a wrapper for as.character(Unicode::u_char_from_name(x))
.
However missing values are coerced to NA_character_
instead of "<NA>"
.
Note the names of bm_font()
objects must be character vectors as returned
by these functions and not Unicode::u_char
objects.
A character vector of Unicode code points.
ucp2label()
and is_combining_character()
.
# These are all different ways to get the same 'R' code point hex2ucp("52") hex2ucp(as.hexmode("52")) hex2ucp("0052") hex2ucp("U+0052") hex2ucp("0x0052") int2ucp(82) # 82 == as.hexmode("52") int2ucp("82") # 82 == as.hexmode("52") int2ucp(utf8ToInt("R")) ucp2label("U+0052") name2ucp("LATIN CAPITAL LETTER R") str2ucp("R") # Potential gotcha as as.hexmode("52") == as.integer("82") == 52L all.equal(hex2ucp(52L), int2ucp(52L)) # TRUE all.equal(hex2ucp("52"), int2ucp("82")) # TRUE all.equal(hex2ucp("82"), int2ucp("82")) # FALSE block2ucp("Basic Latin") block2ucp("Basic Latin", omit_unnamed = FALSE) range2ucp("U+0020..U+0030")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.