@staticmethod
def __strescape(string):
    """Escapes a string: hexifies it."""
    result = ''
    for fchar in string:
        if ord(fchar) >= 32 and ord(fchar) < 127:
            result += fchar
        else:
            result += '%02x' % ord(fchar)
    return result
