Skip to content
This repository was archived by the owner on Aug 7, 2018. It is now read-only.

New database options: collation and client_encoding #6

Open
wants to merge 2 commits into
base: django-1.4-encoding
Choose a base branch
from
Open

New database options: collation and client_encoding #6

wants to merge 2 commits into from

Conversation

tricoder42
Copy link

Hi there,
I'm sending fixed commits.

First, I've fixed the collation option, since it was using the old-style DATABASE_OPTIONS settings.

Second, I had a problem with UTF-8. I got UnicodeDecodeError that some string can't be decoded to UTF-8. I wasn't able to configure FreeTDS/ODBC to use utf, so I rather added another option — client_encoding. Setting this option to 'latin-1' fixed my problem. I tried to look for simpler solution, but haven't found anything.

Since I'm not able to configure FreeTDS/ODBC client to use utf-8,
everything is encoded in latin-1. Thus, the decode('utf-8') throws
UnicodeDecodeError when it comes to non-ascii characters.
Client_encoding option allows me to specify the input encoding.
Iv pushed a commit to Iv/django-pyodbc that referenced this pull request Jun 28, 2013
Iv pushed a commit to Iv/django-pyodbc that referenced this pull request Jun 28, 2013
onysos pushed a commit to onysos/django-pyodbc that referenced this pull request Apr 15, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant