transliterate: Transliterate text to ASCII

View source: R/primitives.R

transliterateR Documentation

Transliterate text to ASCII

Description

Like removeaccents(), but also romanises the Greek and Cyrillic blocks (the Greek and Cyrillic spellings of "Athena" and "Moskva" fold to those ASCII forms), following ICU's ⁠Any-Latin; Latin-ASCII⁠ mapping. Other non-Latin scripts (Han, Kana, Arabic, Hebrew, Devanagari, Thai, ...) are left unchanged rather than guessed at. No Unicode library dependency.

Usage

transliterate(x)

Arguments

x

An atomic vector.

Value

A character vector the same length as x.

See Also

removeaccents() for Latin only.

Examples

# "Zurich", Greek "Athena", Cyrillic "Moskva" (spelt via code points so
# this help page stays ASCII)
greek <- intToUtf8(c(0x391, 0x3b8, 0x3ae, 0x3bd, 0x3b1))
cyrillic <- intToUtf8(c(0x41c, 0x43e, 0x441, 0x43a, 0x432, 0x430))
transliterate(c("Zurich", greek, cyrillic))

basetable documentation built on Sept. 18, 2026, 9:13 a.m.