asciify: Convert non-ASCII characters to their ASCII equivalents

View source: R/asciify.R

asciifyR Documentation

Convert non-ASCII characters to their ASCII equivalents

Description

This function replaces non-ASCII characters in a string with their ASCII equivalents. It supports a range of European non-ASCII characters, including Icelandic, Swedish, Norwegian, Danish, Finnish, German, Estonian, Latvian, Lithuanian, Polish, Hungarian, Slovenian, Czech, Slovak, Maltese, Romanian, Albanian, and Croatian.

Usage

asciify(x, verify = TRUE)

Arguments

x

A character vector to be processed.

verify

A logical value indicating whether to verify that the result is ASCII. Defaults to TRUE. If FALSE, the function will not check that the result is ASCII and it may return non-ASCII characters.

Value

A character vector with non-ASCII characters replaced by their ASCII equivalents.

Examples

asciify("Jón Þór Birgisson") # "Jon Thor Birgisson"
asciify("förståndshandikapp") # "forstandshandikapp"
asciify("Viðareiði") # "Vidareidi"
asciify("übermensch") # "uebermensch"
asciify("Jürgen Klopp") # "Juergen Klopp"
asciify("rõõmsameelsus") # "roomsameelsus"
asciify("Mężczyzna") # "Mezczyzna"
asciify("Škoda") # "Skoda"


torfason/zulutils documentation built on Aug. 21, 2023, 5:46 p.m.