def force_bytes(data, encoding="utf-8"): if isinstance(data, bytes): return data if isinstance(data, str): return data.encode(encoding) return data def force_text(data, encoding="utf-8"): if isinstance(data, str): return data if isinstance(data, bytes): return data.decode(encoding) return str(data, encoding)
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
__init__.py | File | 0 B | 0644 |
|
encoding.py | File | 372 B | 0644 |
|