MCPcopy Index your code
hub / github.com/clips/pattern / encode_utf8

Function encode_utf8

pattern/web/imap/__init__.py:46–54  ·  view source on GitHub ↗

Returns the given string as a Python byte string (if possible).

(string)

Source from the content-addressed store, hash-verified

44 return unicode(string)
45
46def encode_utf8(string):
47 """ Returns the given string as a Python byte string (if possible).
48 """
49 if isinstance(string, unicode):
50 try:
51 return string.encode("utf-8")
52 except:
53 return string
54 return str(string)
55
56#### IMAP4 SSL #####################################################################################
57# Fixes an issue in Python 2.5- with memory allocation.

Callers 9

saveMethod · 0.85
nameMethod · 0.85
_hashMethod · 0.85
__setitem__Method · 0.85
__getitem__Method · 0.85
xmlFunction · 0.85
parse_xmlFunction · 0.85
csv_header_encodeFunction · 0.85
saveMethod · 0.85

Calls 2

strFunction · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…