I have a layer loaded from a WFS server that contains fields with æøå in some of the names. I am making SQL queries to make virtual layers from this layer, but whenever I query a field with æøå in its name, it only returns an empty layer. I am mainly trying to do this with pyqgis, but have tried from the QGIS GUI as well with the same results. Note that there is no problem if the value contains æøå, just the field name. Does anyone know how to fix this, or a workaround?
example of my SQL query:
"SELECT * FROM TettstedInngangBygg WHERE dørtype = 'skyvedør'"
I got the layer TettstedInngangBygg from the WFS: https://wfs.geonorge.no/skwms1/wfs.tilgjengelighettettsted?request=GetCapabilities&service=WFS
EDIT: By writing the following code in python console:
field_names = [field.name() for field in vlayer.pendingFields() ] print field_names
I get the name u'd\xf8rtype'. I have tryed to write the name like that, but withe the same result as before.
UPDATE: It seems that if i add a where statement before a statement with special characters, it works fine. I don't know why this is. By adding something that is always true, i make it work, but it does not look very pretty, and i would like to know why it only works like this.
eksample of working query:
"SELECT * FROM TettstedInngangBygg WHERE lokalId > 0 AND dørtype = 'skyvedør'"