Closed GoogleCodeExporter closed 9 years ago
Could you try the following:
Open ~/.config/crunchyfrog/datasources.cfg with a text editor.
Look for an URL in this file that describes your connection (a line
starting with "url = mssql://").
Append "?charset=utf-8" or "?charset=utf8" at the end of this URL.
Restart CrunchyFrog and try your query again.
I don't have access to a SQL Server instance, so I can't test it myself
ATM.
Thanks!
Original comment by albrecht.andi
on 11 Nov 2010 at 11:35
I tried with those two options but the result was worst. It don't even show any
column and the Traceback was:
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/cf/ui/editor.py", line 344, in exec_threaded
query.execute(True)
File "/usr/lib/pymodules/python2.6/cf/db/__init__.py", line 660, in execute
self.rows = dbapi_cur.fetchall()
File "/usr/lib/pymodules/python2.6/pymssql.py", line 307, in fetchall
list = [tuple([row[r] for r in sorted(row.keys()) if type(r) == int]) for row in self._source]
File "/usr/lib/python2.6/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe9 in position 5: invalid
continuation byte
Anyway, I did some queries on a console with an script and found that the
column that produce this behavior is on Latin1 so I changed the datasouce to
charset=latin1 and it worked perfectly.
So, ¿there's some way to autodetect the encoding of the schema to use the
appropriate encoding?, or at least one should have some option to chose it.
Thanks.
Ernesto
Original comment by edo...@gmail.com
on 11 Nov 2010 at 1:57
Adding an option when defining the datasource sounds reasonable. Thanks for the
feedback!
Original comment by albrecht.andi
on 11 Nov 2010 at 2:19
This issue was closed by revision bf560fad0b.
Original comment by albrecht.andi
on 14 Nov 2010 at 8:02
Original issue reported on code.google.com by
edo...@gmail.com
on 10 Nov 2010 at 8:28