(s, enc='utf8')
| 124 | |
| 125 | # Some helpers for string/byte handling |
| 126 | def tob(s, enc='utf8'): |
| 127 | return s.encode(enc) if isinstance(s, unicode) else bytes(s) |
| 128 | def touni(s, enc='utf8', err='strict'): |
| 129 | return s.decode(enc, err) if isinstance(s, bytes) else unicode(s) |
| 130 | tonat = touni if py3k else tob |
no outgoing calls
no test coverage detected