Unicode (UTF8) in dbhas on 2.5

Yves Dorfsman yves at zioup.com
Mon Oct 20 09:29:44 EDT 2008


Can you put UTF-8 characters in a dbhash in python 2.5 ?
It fails when I try:

    #!/bin/env python
    # -*- coding: utf-8 -*-
    
    import dbhash
    
    db = dbhash.open('dbfile.db', 'w')
    db[u'smiley'] = u'☺'
    db.close()

Do I need to change the bsd db library, or there is no way to make it work
with python 2.5 ?

What about python 2.6 ?


Thanks.

-- 
Yves.
http://www.sollers.ca/blog/2008/no_sound_PulseAudio
http://www.sollers.ca/blog/2008/PulseAudio_pas_de_son/.fr



More information about the Python-list mailing list