Menu

problems with characters

Help
2004-02-12
2004-02-12
  • Rikard Björklind

    I'm trying to use pyqt_memaid. The homepage has nice arabic characters, but when I try to write something else than ordinary ascii chars (russian in this case), I get the following message:

    File "/usr/lib/python2.3/site-packages/pyqt_memaid/memaid_core.py", line 151, in new_id
        digest = md5.new(self.q + self.a + time.ctime()).digest()
    UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)

    What is wrong? I've tried to export LANG to en_US.UTF-8 and all sorts of other things but It won't work. Thanks for any pointers.

     
    • Peter Bienstman

      Peter Bienstman - 2004-02-12

      What happens if you open a Python prompt and you type:

      >>>import sys
      >>>sys.setappdefaultencoding("utf-8")

      What you could also try is switching your default system encoding to UTF, which as far as I know, is distribution specific. On Gentoo Linux, I don;t have to do anything special to get it to work.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.