NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

strings.py (571B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\eveProto\monolith_converters\strings.py
      2 from __future__ import absolute_import
      3 import six
      4 
      5 def sanitize_text(text):
      6     if six.PY3 and isinstance(text, str):
      7         return text
      8     try:
      9         return text.decode('utf-8')
     10     except Exception:
     11         if isinstance(text, bytes):
     12             return _repr_without_quotes(text)
     13         return repr(text)
     14 
     15 
     16 def _repr_without_quotes(binary):
     17     binary_repr = repr(binary)
     18     return binary_repr[binary_repr.index(binary_repr[-1]) + 1:-1]