[xmlsec] Re: non us-ascii filenames in user locale
Daniel Veillard
veillard at redhat.com
Fri Jun 25 11:10:16 PDT 2004
On Fri, Jun 25, 2004 at 06:40:54PM +0300, Roumen Petrov wrote:
> Now this is too long discussion but without success.
> My problem how to sign "modèle.txt" is not solved.
"modèle.txt" is not an URI Reference, it's a file path. Trying
to base conclusion on the way to handle a file path using the
RFC 2396 which deals with URIs is not the best way to move forward.
If you URI-escape the filename, I bet that libxml2 will be able
to read it even if you pass an URI instead of a filename. So now
that URI can be used as such "mod%C3%A8le.xml" for all URI based processing
too.
paphio:~/tmp -> ls -l mod*.xml
-rw-rw-r-- 1 veillard www 7 Jun 25 20:06 modèle.xml
paphio:~/tmp -> xmllint modèle.xmll
<?xml version="1.0"?>
<doc/>
paphio:~/tmp -> xmllint mod%C3%A8le.xml
<?xml version="1.0"?>
<doc/>
paphio:~/tmp ->
If you know the encoding, if the filename is non-ascii, then UTF-8
encode it, URI-escape it at you level before calling any of the libraries
and it should just work ! You just need to pass an URI and not a filename.
Daniel
--
Daniel Veillard | Red Hat Desktop team http://redhat.com/
veillard at redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
More information about the xmlsec
mailing list