MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / pack

Method pack

opcua/ua/ua_binary.py:66–74  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

64class _String(object):
65 @staticmethod
66 def pack(string):
67 if string is not None:
68 if sys.version_info.major > 2:
69 string = string.encode('utf-8')
70 else:
71 # we do not want this test to happen with python3
72 if isinstance(string, unicode):
73 string = string.encode('utf-8')
74 return _Bytes.pack(string)
75
76 @staticmethod
77 def unpack(data):

Callers

nothing calls this directly

Calls 1

packMethod · 0.45

Tested by

no test coverage detected