# Kitchen.text: unicode and utf8 and xml oh my!

The kitchen.text module contains functions that deal with text manipulation.

- Kitchen.text.converters
  - Byte Strings and Unicode in Python2
  - Strategy for Explicit Conversion
    - When to use an alternate strategy
  - Gotchas and how to avoid them
    - str(obj)
    - print
    - Unicode, str, and dict keys
- Functions
  - Unicode and byte str conversion
    - `to_unicode()`
    - `to_bytes()`
    - `getwriter()`
    - `to_str()`
    - `to_utf8()`
  - Transformation to XML
    - `unicode_to_xml()`
    - `xml_to_unicode()`
    - `byte_string_to_xml()`
    - `xml_to_byte_string()`
    - `bytes_to_xml()`
    - `xml_to_bytes()`
    - `guess_encoding_to_xml()`
    - `to_xml()`
  - Working with exception messages
    - `EXCEPTION_CONVERTERS`
    - `BYTE_EXCEPTION_CONVERTERS`
    - `exception_to_unicode()`
    - `exception_to_bytes()`
- Format Text for Display
- `textual_width()`
- `textual_width_chop()`
- `textual_width_fill()`
- `wrap()`
- `fill()`
- `byte_string_textual_width_fill()`
- Internal Data
  - `_COMBINING`
  - `_generate_combining_table()`
  - `_print_combining_table()`
  - `_interval_bisearch()`
  - `_ucp_width()`
  - `_textual_width_le()`
- Miscellaneous functions for manipulating text
- `byte_string_valid_encoding()`
- `byte_string_valid_xml()`
- `guess_encoding()`
- `html_entities_unescape()`
- `isbasestring()`
- `isbytestring()`
- `isunicodestring()`
- `process_control_chars()`
- `str_eq()`
- UTF-8
- `utf8_text_fill()`
- `utf8_text_wrap()`
- `utf8_valid()`
- `utf8_width()`
- `utf8_width_chop()`
- `utf8_width_fill()`

`converters`

  deals with converting text for different encodings and to and from XML

`display`

  deals with issues with printing text to a screen

`misc`

  is a catchall for text manipulation functions that don’t seem to fit elsewhere

`utf8`

  contains deprecated functions to manipulate utf8 byte strings