You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Stefan Wachter <St...@gmx.de> on 2007/04/24 18:09:56 UTC

[users@httpd] How to translate UTF-8 URLs into ISO-8859-1 filenames

Hi all,

I have a filesystem with its filenames encoded using ISO-8859-1. The 
files are to be accessed by an Httpd 2.0.

As far as I understood Httpd accepts UTF-8 encoded URLs and can use 
these URLs to access files (e.g. by an Alias directive). Is it possible 
to translate the UTF-8 encoded URL such that a ISO-8859-1 encoded 
filename is accessed?

Thanks for your attention,
--Stefan


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: How to translate UTF-8 URLs into ISO-8859-1 filenames

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Stefan Wachter wrote:
> 
> Now both, UTF-8 and ISO-8859-1 encoded URLs are served.

Interesting solution!

> I would be nice if Httpd could solve such problems in future. It would
> be great if one could check the encoding of incoming URLs and reencode
> them if necessary by simple means.

The problem is that, by RFC 2616, URLs have no encoding (non ASCII data
> \0x7f is opaque).  If URL's are ever formalized to have an encoding,
it's most likely they will be declared utf-8.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: How to translate UTF-8 URLs into ISO-8859-1 filenames

Posted by Stefan Wachter <st...@gmx.de>.
Hi Eric,

thanks for the advice. I had a look on external RewriteMap programs. This will become an option if 
my current solution reaches its limit.

Now I simply store the files whose filenames contain non-ascii characters two times. One time they 
are stored with an UTF-8 encoded filename and another time with an ISO-8859-1 encoded filename. I 
used the convmv command to accomplish this.

Now both, UTF-8 and ISO-8859-1 encoded URLs are served.

I would be nice if Httpd could solve such problems in future. It would be great if one could check 
the encoding of incoming URLs and reencode them if necessary by simple means.

--Stefan


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to translate UTF-8 URLs into ISO-8859-1 filenames

Posted by Eric Covener <co...@gmail.com>.
On 4/24/07, Stefan Wachter <St...@gmx.de> wrote:
> Hi all,
>
> I have a filesystem with its filenames encoded using ISO-8859-1. The
> files are to be accessed by an Httpd 2.0.
>
> As far as I understood Httpd accepts UTF-8 encoded URLs and can use
> these URLs to access files (e.g. by an Alias directive). Is it possible
> to translate the UTF-8 encoded URL such that a ISO-8859-1 encoded
> filename is accessed?

I don't think you can count on the input character set, but if you
know how your links are created and possibly what clients are in use,
you can use an external RewriteMap program to try to convert as
appropriate


-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org