module documentation

Encoding / decoding utilities

Class TextStrAlias A helper base or mixin class which adds __str__ method as an alias of getText method but marks it as deprecated
Class WireStrAlias A helper base or mixin class which adds __str__ method as an alias of toWire method but marks it as deprecated
Function get_strings Getting tuple of available string values (byte string and unicode string) for given value
Function to_bytes Converts value to its bytes representation:
Function to_unicode Converts string to unicode:
def get_strings(value): (source)

Getting tuple of available string values (byte string and unicode string) for given value

def to_bytes(value): (source)

Converts value to its bytes representation: * Uses value`s toWire method if it has one * Encodes to utf-8 if the value is a unicode string * Otherwise wraps value into bytes()

def to_unicode(value): (source)

Converts string to unicode: * Decodes value from utf-8 if it is a byte string * Otherwise just returns the same value