Forum Moderators: phranque

Message Too Old, No Replies

Accents workaround

Having trouble having mod_rewrite understand accents.

         

phoenix_fly

10:43 pm on Aug 27, 2007 (gmt 0)

10+ Year Member



Hello esteemed code fellows

I have a rewrite rule that sometimes has to do this:

Convert:
http://www.example.com/authors/Müller
To:
http://www.example.com/scripts/showauthors.cgi?input=Müller

The problem is that mod_rewrite seems to not understand accents, and transforms "Müller" into "Müller".

Does anyone know of a workaround for that?

Here's the rule:
RewriteCond %{REQUEST_URI}!\.(cgi¦css¦gif¦jpg)$
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^authors/([^\/]+) /home/thissite/www/scripts/showauthors.cgi?input=$1 [L]

Thanks a lot

André

jdMorgan

12:21 am on Aug 28, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You might want to check to find out what character-set your server is configured to use, and try changing it to one which supports the extended codes needed for accented characters. See Apache mod_mime AddCharset and DefaultLanguage directives.

Jim

phoenix_fly

6:08 pm on Aug 28, 2007 (gmt 0)

10+ Year Member



Hello Jim

I checked the directives you mentioned, and it seems I am already pretty well served of intenationalization on them.

Also, this makes sense because when I type:
http://www.example.com/scripts/showauthors.cgi?input=Müller
the accent works just fine, and I get the results page.

The problem is when I get to this url through a mod_rewrite link.

For instance,
http://www.example.com/authors/Brandão
gets me to
http://www.example.com/scripts/showauthors.cgi?input=Brandão

Isn't there anything I can do at my directives, to try get this accents working properly?

Thanks a lot

Andrew