medkit.text.utils.decoding
medkit.text.utils.decoding#
Functions:
|
Function returning the (closest) ascii text when possible |
- get_ascii_from_unicode(text, keep_length=True, logger=None)[source]#
Function returning the (closest) ascii text when possible
- Parameters
text (
str
) – The unicode text to decode to asciikeep_length (
bool
) – If True, special characters which change the length are kept in returned stringlogger – Logger to pass if one wants to keep caller information
- Return type
str
- Returns
str – The closest ascii text