Thanks for your help.

I post here my solution for everyone:

from __future__ import unicode_literals

,...

for fn in os.listdir(cad_dir):
    fitxer = fn.decode('utf-8')
    if fitxer.endswith('.dxf'):
        vlayer = QgsVectorLayer(fitxer, 'layer_test', 'ogr')
        ,...


2015-03-03 8:43 GMT+01:00 Jakob Lanstorp <[email protected]>:

> You can use a u-prefix indicating unicode.
>
> f = u"/home/abusquets/avió/dades.shp"
> vlayer = QgsVectorLayer(f, "layer_name_you_like", "ogr")
> print vlayer.isValid()
>
> Jakob
>
>
>
> -----
> Jakob Lanstorp
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/pyqgis-vector-layer-with-an-accented-path-tp5190931p5191089.html
> Sent from the Quantum GIS - User mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-user mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/qgis-user
_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to