Re: Encoding issue, clues needed

From: Jeroen Ruigrok van der Werven (asmodai@in-nomine.org)
Date: Fri Dec 28 2007 - 14:16:18 CST

  • Next message: Mark Davis: "Re: List of Latin characters which look the same but are encoded differently"

    It turns out this is a problem on all Unix systems using ncurses past version
    5.3.
    As of version 5.4 and later you need a setlocale() call first. Within Python
    this is equivalent to:

    import locale
    locale.setlocale(locale.LC_ALL, '')

    After that you can do something like:

    code = locale.getpreferredencoding()

    And use code's value in the string.encode() method as encoding parameter.

    -- 
    Jeroen Ruigrok van der Werven <asmodai(-at-)in-nomine.org> / asmodai
    イェルーン ラウフロック ヴァン デル ウェルヴェン
    http://www.in-nomine.org/ | http://www.rangaku.org/
    In every stone sleeps a crystal...
    


    This archive was generated by hypermail 2.1.5 : Fri Dec 28 2007 - 14:20:50 CST