Index: share/extensions/embedimage.py =================================================================== --- share/extensions/embedimage.py (révision 22529) +++ share/extensions/embedimage.py (copie de travail) @@ -56,9 +56,8 @@ if xlink is None or xlink[:5] != 'data:': absref=node.get(inkex.addNS('absref','sodipodi')) url=urlparse.urlparse(xlink) - href=urllib.unquote(url.path) - if os.name == 'nt' and href[0] == '/': - href = href[1:] + href=urllib.url2pathname(url.path) + path='' #path selection strategy: # 1. href if absolute @@ -70,10 +69,12 @@ if (absref != None): path=absref + path=unicode(path, "utf-8") + if (not os.path.isfile(path)): inkex.errormsg(_('No xlink:href or sodipodi:absref attributes found, or they do not point to an existing file! Unable to embed image.')) if path: - inkex.errormsg(_("Sorry we could not locate %s") % path) + inkex.errormsg(_("Sorry we could not locate %s") % path.encode("ascii", "replace")) if (os.path.isfile(path)): file = open(path,"rb").read() @@ -98,7 +99,7 @@ if (absref != None): del node.attrib[inkex.addNS('absref',u'sodipodi')] else: - inkex.errormsg(_("%s is not of type image/png, image/jpeg, image/bmp, image/gif, image/tiff, or image/x-icon") % path) + inkex.errormsg(_("%s is not of type image/png, image/jpeg, image/bmp, image/gif, image/tiff, or image/x-icon") % path.encode("ascii", "replace")) if __name__ == '__main__': e = Embedder()