MCPcopy Create free account
hub / github.com/NanmiCoder/MediaCrawler / encodeUtf8

Function encodeUtf8

media_platform/xhs/help.py:235–249  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

233
234
235def encodeUtf8(e):
236 b = []
237 m = urllib.parse.quote(e, safe='~()*!.\'')
238 w = 0
239 while w < len(m):
240 T = m[w]
241 if T == "%":
242 E = m[w + 1] + m[w + 2]
243 S = int(E, 16)
244 b.append(S)
245 w += 2
246 else:
247 b.append(ord(T[0]))
248 w += 1
249 return b
250
251
252def base36encode(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'):

Callers 1

signFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected