(s, enc='utf8')
| 136 | |
| 137 | # Some helpers for string/byte handling |
| 138 | def tob(s, enc='utf8'): |
| 139 | if isinstance(s, unicode): |
| 140 | return s.encode(enc) |
| 141 | return b'' if s is None else bytes(s) |
| 142 | |
| 143 | |
| 144 | def touni(s, enc='utf8', err='strict'): |
no outgoing calls
no test coverage detected