MCPcopy Create free account
hub / github.com/ActiveState/code / convert65536

Function convert65536

recipes/Python/579107_simplify_webpage/recipe-579107.py:125–134  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

123 textwindow(p)
124
125def convert65536(s):
126 #convert out-of-range characters
127 res = []
128 for c in s:
129 k = ord(c)
130 if k < 65536:
131 res.append(c)
132 else:
133 res.append("{"+str(k)+"?}")
134 return "".join(res)
135
136def gethtml(link):
137 user_agent = "Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Firefox/38.0"

Callers 1

textwindowFunction · 0.85

Calls 3

strFunction · 0.85
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected