Re: Encoding issue, clues needed

From: Jeroen Ruigrok van der Werven (
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
    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-)> / asmodai
    イェルーン ラウフロック ヴァン デル ウェルヴェン |
    In every stone sleeps a crystal...

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