Hi,
i'm coding a system using Django Pyodbc and SQL Server 2005.
But i've a problem of encoding when i try to save some complex string like 
"éei«éíπ≤Æ∫" in sql server through pyodbc.
The error was always "'not enough arguments for format string'"

i've identified the line in the file base.py in pyodbc folder : 

if isinstance(p, unicode):
>                 if self.driver_needs_utf8:
>                     # FreeTDS (and other ODBC drivers?) doesn't support 
> Unicode
>                     # yet, so we need to encode parameters in utf-8
>                     fp.append(p.encode('utf-8'))
>                 else:
>                     fp.append(p)
>             elif isinstance(p, str):
>                 if self.driver_needs_utf8:
>                     # TODO: use system encoding when calling decode()?
>                     *fp.append(p.decode('utf-8').encode('utf-8'))*
>                 else:
>                     fp.append(p)
>             elif isinstance(p, type(True)):
>                 if p:
>                     fp.append(1)
>                 else:
>                     fp.append(0)
>             else:
>                 fp.append(p)
>

Can anyone help me ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/XyjqLX9YR28J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to