PyQT: QString to String Problem if ASCII>128

Ingo Linkweiler i.linkweiler at gmx.de
Fri Mar 8 14:53:27 EST 2002


no ideas?

I found a possible solution, but is this the best way?

    uc=self.edit.text()
    try:
      t=str(uc)
    except:
      try:
        t=unicode(self.edit.text()).encode("cp437")
      except:
        t="invalid char in string"

Ingo





More information about the Python-list mailing list