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