(string)
| 64 | class _String(object): |
| 65 | @staticmethod |
| 66 | def pack(string): |
| 67 | if string is not None: |
| 68 | if sys.version_info.major > 2: |
| 69 | string = string.encode('utf-8') |
| 70 | else: |
| 71 | # we do not want this test to happen with python3 |
| 72 | if isinstance(string, unicode): |
| 73 | string = string.encode('utf-8') |
| 74 | return _Bytes.pack(string) |
| 75 | |
| 76 | @staticmethod |
| 77 | def unpack(data): |