(encoding)
| 250 | |
| 251 | |
| 252 | def _is_utf(encoding): |
| 253 | try: |
| 254 | '\u2588\u2589'.encode(encoding) |
| 255 | except UnicodeEncodeError: |
| 256 | return False |
| 257 | except Exception: |
| 258 | try: |
| 259 | return encoding.lower().startswith('utf-') or ('U8' == encoding) |
| 260 | except Exception: |
| 261 | return False |
| 262 | else: |
| 263 | return True |
| 264 | |
| 265 | |
| 266 | def _supports_unicode(fp): |
no test coverage detected