def decodeVariableValue(self, encodedValue):
        """Decode encoded burst, record, field and array item separator
        characters in a variable value String received from the client.
        This protects from separator injection attacks.

        @param encodedValue: value to decode
        @return: decoded value
        """
        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 __HOLE__:
                break

        r = result.getvalue()
        result.close()
        return r
dataset/ETHPy150Open rwl/muntjac/muntjac/terminal/gwt/server/abstract_communication_manager.py/AbstractCommunicationManager.decodeVariableValue