medkit.text.utils.decoding#

Functions:

get_ascii_from_unicode(text[, keep_length, ...])

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 ascii

  • keep_length (bool) – If True, special characters which change the length are kept in returned string

  • logger – Logger to pass if one wants to keep caller information

Return type

str

Returns

str – The closest ascii text