I get the feeling that you are not very accustomed to using Unicode. To begin with (1):
"There Ain't No Such Thing As Plain Text.
If you have a string, in memory, in a
file, or in an email message, you have
to know what encoding it is in or you
cannot interpret it or display it to
users correctly."
u in front of a text marks that you are dealing with a unicode
object instead of string
object. Thus, if you make a string representation of a unicode object, the u will always appear.
In order to remove the u, you need to encode the unicode
object with some specific encoding. For instance, if you are using a console that has utf-8 encoding, you wish to create an utf-8
encoded string representation of your data.
Unicode objects can be encoded with encode
. For instance:
print row[0].encode('utf-8')
Should result in
2006-01-05
...IF your console/terminal is using the same encoding (utf-8).
Similarly you can iterate through the tuples:
for row in c:
print tuple(x.encode('utf-8') for x in row)
I absolutely, positively recommend, possibly even insist you to read "The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)". Unicode may be tough to begin with, but when you master the concepts, it will be your new best friend - and the more u
's you will see, the happier you will get. Trust me.