asciify#

class asciify(string, form='NFKD', encoding='ascii', errors='ignore', **kwargs)[source]#

Convert an arbitrary Unicode string to ASCII.

Parameters:
  • form (str) – the type of Unicode normalization to use

  • encoding (str) – the output string to encode to

  • errors (str) – how to handle errors

  • kwargs (dict) – passed to string.decode()

Example::

sc.asciify(‘föö→λ ∈ ℝ’) # Returns ‘foo R’

New in version 2.0.1.