transliterate_anyascii(string)
Converts Unicode characters in a <string> to their best ASCII representation.
CREATE OR REPLACE FUNCTION `justfunctions.eu.transliterate_anyascii`(`string` string) RETURNS string
LANGUAGE js AS r'''try {
return utils.anyAscii(string);
} catch (e) {
return string
}
''' OPTIONS ( description = '''Converts Unicode characters in a <string> to their best ASCII representation.''' , library = [ "gs://justfunctions/bigquery-functions/transliteration.js" ] )
Example
SELECT `justfunctions.eu.transliterate_anyascii`("καλημέρα")
kalimera