When importing data (russian characters) from a .csv-file into a table, an 
error occurs:
<class 'UnicodeDecodeError'> 'ascii' codec can't decode byte 0xd0 in 
position 65: ordinal not in range(128).

Standalone PyDAL works fine!
=============================================================================
import locale 
print('locale.getpreferredencoding(False) =', 
locale.getpreferredencoding(False))

db.import_from_csv_file(
open('applications/upoweron/databases/csv/all.csv'),
restore=True,
encoding="utf-8",
)

db.commit()
=============================================================================
Result:
locale.getpreferredencoding(False) = ANSI_X3.4-1968

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/f7b13070-34b6-49f7-aa2c-1cedca02de86%40googlegroups.com.

Reply via email to