<div dir="ltr"><div><div>Thanks for your help.</div><div><br></div><div>I post here my solution for everyone:</div><div><br></div><div>from __future__ import unicode_literals</div><div><br></div><div>,...</div><div><br></div><div>for fn in os.listdir(cad_dir):</div><div>    fitxer = fn.decode('utf-8')</div><div>    if fitxer.endswith('.dxf'): </div><div>        vlayer = QgsVectorLayer(fitxer, 'layer_test', 'ogr')</div><div>        ,...</div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-03 8:43 GMT+01:00 Jakob Lanstorp <span dir="ltr"><<a href="mailto:jlanstorp@gmail.com" target="_blank">jlanstorp@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can use a u-prefix indicating unicode.<br>
<br>
f = u"/home/abusquets/avió/dades.shp"<br>
<span class="">vlayer = QgsVectorLayer(f, "layer_name_you_like", "ogr")<br>
print vlayer.isValid()<br>
<br>
</span>Jakob<br>
<br>
<br>
<br>
-----<br>
Jakob Lanstorp<br>
--<br>
View this message in context: <a href="http://osgeo-org.1560.x6.nabble.com/pyqgis-vector-layer-with-an-accented-path-tp5190931p5191089.html" target="_blank">http://osgeo-org.1560.x6.nabble.com/pyqgis-vector-layer-with-an-accented-path-tp5190931p5191089.html</a><br>
Sent from the Quantum GIS - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a></blockquote></div><br></div>