MCPcopy Create free account
hub / github.com/doraemonext/wechat-python-sdk / _transcoding

Method _transcoding

wechat_sdk/base.py:8–21  ·  view source on GitHub ↗

编码转换 :param data: 需要转换的数据 :return: 转换好的数据

(cls, data)

Source from the content-addressed store, hash-verified

6
7 @classmethod
8 def _transcoding(cls, data):
9 """编码转换
10 :param data: 需要转换的数据
11 :return: 转换好的数据
12 """
13 if not data:
14 return data
15
16 result = None
17 if isinstance(data, str) and hasattr(data, 'decode'):
18 result = data.decode('utf-8')
19 else:
20 result = data
21 return result
22
23 @classmethod
24 def _transcoding_list(cls, data):

Callers 5

_transcoding_dictMethod · 0.80
response_textMethod · 0.80
response_videoMethod · 0.80
response_musicMethod · 0.80
response_newsMethod · 0.80

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected