MCPcopy Create free account
hub / github.com/apache/qpid-proton / string2utf8

Function string2utf8

python/cproton.py:178–185  ·  view source on GitHub ↗

Convert python string into bytes compatible with char* C string

(string)

Source from the content-addressed store, hash-verified

176
177
178def string2utf8(string):
179 """Convert python string into bytes compatible with char* C string"""
180 if string is None:
181 return ffi.NULL
182 elif isinstance(string, str):
183 return string.encode('utf8')
184 # Anything else illegal - specifically python3 bytes
185 raise TypeError("Unrecognized string type: %r (%s)" % (string, type(string)))
186
187
188def utf82string(string):

Callers 15

pn_condition_set_nameFunction · 0.85
pn_data_lookupFunction · 0.85
pn_connection_set_userFunction · 0.85
pn_senderFunction · 0.85
pn_receiverFunction · 0.85
pn_terminus_set_addressFunction · 0.85
pn_message_set_addressFunction · 0.85

Calls 2

typeClass · 0.85
encodeMethod · 0.45

Tested by

no test coverage detected