Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow set of driver_needs_utf8 option #24

Merged
merged 2 commits into from
Apr 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,17 @@ The following settings control the behavior of the backend:
``"Chinese_PRC_CI_AS"``. The default collation for the database
will be used if no value is specified.

``encoding``
String. Encoding used to decode data from this database. Default is 'utf-8'.
``encoding``
String. Encoding used to decode data from this database. Default is 'utf-8'.

``driver_needs_utf8``
Boolean. Some drivers (FreeTDS, and other ODBC drivers?) don't support
Unicode yet, so SQL clauses' encoding is forced to utf-8 for those
cases.

If this option is not present, the value is guessed according to the
driver set.



License
Expand Down
1 change: 1 addition & 0 deletions django_pyodbc/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def __init__(self, *args, **kwargs):
self.datefirst = options.get('datefirst', 7)
self.unicode_results = options.get('unicode_results', False)
self.encoding = options.get('encoding', 'utf-8')
self.driver_needs_utf8 = options.get('driver_needs_utf8', None)

# make lookup operators to be collation-sensitive if needed
self.collation = options.get('collation', None)
Expand Down