def assign(self, value, termenc):
        """
        >>> scanner = DefaultScanner()
        >>> scanner.assign("01234", "ascii")
        >>> scanner._data
        u'01234'
        """
        if self._termenc != termenc:
            self._decoder = codecs.getincrementaldecoder(termenc)(errors='replace')
            self._termenc = termenc
        self._data = self._decoder.decode(value)