Str.toAscii

Transliterate @str to plain ASCII.

For best results, @str should be in composed normalised form.

This function performs a reasonably good set of character replacements. The particular set of replacements that is done may change by version or even by runtime environment.

If the source language of @str is known, it can used to improve the accuracy of the translation by passing it as @from_locale. It should be a valid POSIX locale string (of the form "language_territory.codeset[@modifier]").

If @from_locale is %NULL then the current locale is used.

If you want to do translation for no specific locale, and you want it to be done independently of the currently locale, specify "C" for @from_locale.

struct Str
static
string
toAscii
(
string str
,
string fromLocale
)

Parameters

str string

a string, in UTF-8

fromLocale string

the source locale, if known

Return Value

Type: string

a string in plain ASCII

Meta

Since

2.40