2007/8/16, Simen Haugen <[EMAIL PROTECTED]>:
> sys.getfilesystenencodig() returns "mbcs".
>
> If I understand correctly, all strings passed to os.path etc. has to be 
> explicitly set as Unicode...

I think that most of Dabo uses strings, not Unicode.

> os.chdir('ø') # OSError: [Errno 2] No such file or directory: '\x9b'
> os.chdir(u'ø') # OK

Have you tried os.chdir(u'ø'.encode("mbcs"))?

> > Traceback (most recent call last):
> >   File "dptools.py", line 353, in ?
> >   File "dabo\dApp.pyo", line 166, in __init__
> >   File "dabo\dObject.pyo", line 41, in __init__
> >   File "dabo\dApp.pyo", line 467, in _initProperties
> >   File "dabo\dObject.pyo", line 148, in _initProperties
> >   File "dptools.py", line 84, in initProperties
> >   File "dabo\dApp.pyo", line 742, in _setBasePrefKey
> >   File "dabo\dObject.pyo", line 266, in _setBasePrefKey
> >   File "dabo\dObject.pyo", line 340, in _getPreferenceManager
> >   File "dabo\dPref.pyo", line 68, in __init__
> >   File "dabo\db\dConnection.pyo", line 31, in __init__
> >   File "dabo\db\dConnection.pyo", line 73, in _openConnection
> >   File "dabo\db\dConnectInfo.pyo", line 98, in getConnection
> >   File "dabo\db\dbSQLite.pyo", line 53, in getConnection
> >   File "dabo\db\dbSQLite.pyo", line 46, in __init__
> > pysqlite2.dbapi2.OperationalError: unable to open database file

getConnection in dbSQLite.py has code to convert the path from
sys.getfilesystemencoding() to UTF-8. (SQLite accepts UTF-8 only.)

The code could be improved to handle Unicode, of course. Something
like (untested, should replace line 54)

if isinstance(path, unicode):
    path = path.encode("utf-8")
elif sys.getfilesystemencoding():
    path = path.decode(sys.getfilesystemencoding()).encode("utf-8")

(which should also help on platforms where sys.getfilesystemencoding
returns None - I don't know if Dabo supports any)

Wolfram


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to