def decodeVariableValue(self, encodedValue):
        iterator = iter(encodedValue)

        try:
            character = iterator.next()
        except StopIteration:
            return ''

        result = StringIO()
        while True:
            try:
                if self.VAR_ESCAPE_CHARACTER == character:
                    character = iterator.next()
                    if character == chr(ord(self.VAR_ESCAPE_CHARACTER) + 0x30):
                        # escaped escape character
                        result.write(self.VAR_ESCAPE_CHARACTER)

                    elif character == chr(ord(self.VAR_BURST_SEPARATOR) + 0x30):
                        pass
                    elif character == chr(ord(self._VAR_RECORD_SEPARATOR)+0x30):
                        pass
                    elif character == chr(ord(self._VAR_FIELD_SEPARATOR) +0x30):
                        pass
                    elif (character ==
                            chr(ord(self.VAR_ARRAYITEM_SEPARATOR) + 0x30)):
                        # +0x30 makes these letters for easier reading
                        result.write( chr(ord(character) - 0x30) )
                    else:
                        # other escaped character - probably a client-server
                        # version mismatch
                        raise ValueError("Invalid escaped character from the "
                                "client - check that the widgetset and server "
                                "versions match")
                else:
                    # not a special character - add it to the result as is
                    result.write(character)

                character = iterator.next()

            except StopIteration:
                break

        r = result.getvalue()
        result.close()
        return r
Decode encoded burst, record, field and array item separator
dataset/ETHPy150Open rwl/muntjac/muntjac/terminal/gwt/server/abstract_communication_manager.py/AbstractCommunicationManager.decodeVariableValue