sqlite3.OperationalError: Could not decode to UTF-8 column

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Filipe Sousa

    sqlite3.OperationalError: Could not decode to UTF-8 column

    Hi

    I'm trying to use sqlite with python 2.5 but I have this problem:

    Traceback (most recent call last):
    File "converter. py", line 13, in <module>
    c_old.execute(' select id_aluno, nome from aluno')
    sqlite3.Operati onalError: Could not decode to UTF-8 column 'nome' with
    text 'Ana Margarida Fernandes Gonçalves de Sá'

    The database was created with another program and all data is in
    database is in latin1.

    Thanks,
    Filipe Sousa
  • Carsten Haese

    #2
    Re: sqlite3.Operati onalError: Could not decode to UTF-8 column

    On Wed, 2007-09-05 at 16:40 +0100, Filipe Sousa wrote:
    Hi
    >
    I'm trying to use sqlite with python 2.5 but I have this problem:
    >
    Traceback (most recent call last):
    File "converter. py", line 13, in <module>
    c_old.execute(' select id_aluno, nome from aluno')
    sqlite3.Operati onalError: Could not decode to UTF-8 column 'nome' with
    text 'Ana Margarida Fernandes Gonçalves de Sá'
    >
    The database was created with another program and all data is in
    database is in latin1.
    Try setting

    conn.text_facto ry = str

    where conn is the name of your sqlite3 connection object. See
    http://docs.python.org/lib/sqlite3-C...n-Objects.html for more
    information.

    HTH,

    --
    Carsten Haese



    Comment

    • Filipe Sousa

      #3
      Re: sqlite3.Operati onalError: Could not decode to UTF-8 column

      Carsten Haese wrote:
      On Wed, 2007-09-05 at 16:40 +0100, Filipe Sousa wrote:
      >
      Try setting
      >
      conn.text_facto ry = str
      >
      where conn is the name of your sqlite3 connection object. See
      http://docs.python.org/lib/sqlite3-C...n-Objects.html for more
      information.
      >
      HTH,
      >
      Thanks!
      It works :)

      Comment

      Working...