Trying to insert data that user enters in form. I think it's web.py
problem related, because I know it's working if I use sqlite3
directly, but i'm using web.database.

On 6 Maj, 15:18, Tzury Bar Yochay <[email protected]> wrote:
> I didn't have web.py on the machine I was working so I tried doing it
> the python way.
> Anyway, It seems like the Euro sign is stored as unicode in any of the
> cases.
> What exactly are you trying to do?
>
> >>> import sqlite3 as db
> >>> con = db.connect(':memory:')
> >>> cur = con.cursor()
> >>> cur.execute('create table test(t text)')
>
> <sqlite3.Cursor object at 0x9b73bf0>>>> con.commit()
> >>> cur.execute("INSERT INTO test values('€')")
>
> <sqlite3.Cursor object at 0x9b73bf0>>>> con.commit()
> >>> cur.execute("INSERT INTO test values(?)", ('€',))
>
> <sqlite3.Cursor object at 0x9b73bf0>>>> con.commit()
> >>> cur.execute("INSERT INTO test values(?)", (u'€',))
>
> <sqlite3.Cursor object at 0x9b73bf0>>>> con.commit()
> >>> con.execute("SELECT * from test")
>
> <sqlite3.Cursor object at 0x9d21f50>>>> con.execute("SELECT * from 
> test").fetchall()
>
> [(u'\u20ac',), (u'\u20ac',), (u'\u20ac',)]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to