Convert text values into utf-8 or ascii strings.
(value)
| 158 | |
| 159 | @staticmethod |
| 160 | def _text(value): |
| 161 | """Convert text values into utf-8 or ascii strings.""" |
| 162 | if isinstance(value, bytes): |
| 163 | value = value.decode(encoding='utf-8') |
| 164 | elif not isinstance(value, str): |
| 165 | value = str(value) |
| 166 | return value |
| 167 | |
| 168 | |
| 169 | class UnitData: |
no outgoing calls