MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _is_utf

Function _is_utf

pager_lib/tqdm/utils.py:252–263  ·  view source on GitHub ↗
(encoding)

Source from the content-addressed store, hash-verified

250
251
252def _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
266def _supports_unicode(fp):

Callers 1

_supports_unicodeFunction · 0.85

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected