enricofer / postgisQueryBuilder

6 stars 3 forks source link

Fail if connection name is not in ASCII #10

Closed klonuo closed 10 years ago

klonuo commented 10 years ago

Hi,

I have postgis connection in QGIS which I named in Cyrillic (which is hopefully internally stored as UTF-8). When I try to launch this plugin I get Unicode encode error pointing to this line:

https://github.com/enricofer/postgisQueryBuilder/blob/master/postgisquerybuilder.py#L242

 item = QStandardItem(str(elem))

I edited the code like this:

 item = QStandardItem(elem)

so I don't have this issue anymore.

But I guess I was lucky and perhaps you should look closer as I don't know your model.

Keep up your good work.

enricofer commented 10 years ago

Thank you for the brief solution, but as the procedure is used in other situations (for examples for field unique values that can be numbers...) is better to do this:

item = QStandardItem(unicode(elem))

Please Try and give me feedback

enricofer commented 10 years ago

I have done a revision on type casting and on sql fields syntax. Try github development version

klonuo commented 10 years ago

I cloned your repo and replaced QGIS plugin. It works fine.

Thanks