My favorites | Sign in
Project Home Downloads Wiki
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 36: How to always return unicode instead of str in rows
1 person starred this issue and may be notified of changes. Back to list
Status:  Complete
Owner:  ----
Closed:  Mar 2009


 
Reported by patrik.simons@neotide.fi, Feb 18, 2009
I always want unicode strings in the result set rows.

The attached patch adds the keyword argument unicode_strings to
pyodbc.connect(). If it's true, then strings are returned as unicode objects.

unicode_strings.diff
4.9 KB   View   Download
Mar 18, 2009
Project Member #1 mkleehammer
This is a fantastic patch -- consistent even with the pyodbc quirks (differing names
of Booleans).

I've applied and tested it (adding a new test to the sqlserver tests, need to add to
other db unittests).

The only question I have is should the keyword be unicode_strings or just unicode?

Are there other unicode-related flags that may come up (e.g. force unicode queries,
cursor.description fields, etc.)?  If so, would unicode_strings be descriptive enough
to differentiate from these future flags?  Would something like unicode_results be
better?  I'm leaning towards this.
Status: Started
Mar 18, 2009
Project Member #2 mkleehammer
I changed the keyword to unicode_results; I hope you don't mind.  

Thanks again for the extraordinary attention to detail in your patch.

Patch applied to 2.1.5-beta6 0f921e360dad63f6745bceb693cd36b3102caa12, so it will be
in the official 2.1.5


Status: Fixed
Labels: -Type-Defect Type-Enhancement
Mar 18, 2009
#3 patrik.simons@neotide.fi
I don't mind. I only need the functionality, the exact implementation is not important.
Nov 21, 2010
Project Member #4 mkleehammer
(No comment was entered for this change.)
Status: Complete

Powered by Google Project Hosting