From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.140.141.15 with SMTP id o15cs260990rvd; Fri, 15 Jan 2010 08:43:24 -0800 (PST) Received: from mr.google.com ([10.101.88.7]) by 10.101.88.7 with SMTP id q7mr362640anl.6.1263573803897 (num_hops = 1); Fri, 15 Jan 2010 08:43:23 -0800 (PST) Received: by 10.101.88.7 with SMTP id q7mr24898anl.6.1263573799736; Fri, 15 Jan 2010 08:43:19 -0800 (PST) X-BeenThere: rack-devel@googlegroups.com Received: by 10.213.39.202 with SMTP id h10ls501235ebe.2.p; Fri, 15 Jan 2010 08:43:18 -0800 (PST) Received: by 10.213.24.1 with SMTP id t1mr390612ebb.6.1263573798490; Fri, 15 Jan 2010 08:43:18 -0800 (PST) Received: by 10.213.24.1 with SMTP id t1mr390611ebb.6.1263573798471; Fri, 15 Jan 2010 08:43:18 -0800 (PST) Return-Path: Received: from mail-ew0-f228.google.com (mail-ew0-f228.google.com [209.85.219.228]) by gmr-mx.google.com with ESMTP id 12si173491ewy.10.2010.01.15.08.43.18; Fri, 15 Jan 2010 08:43:18 -0800 (PST) Received-SPF: neutral (google.com: 209.85.219.228 is neither permitted nor denied by best guess record for domain of ibc@aliax.net) client-ip=209.85.219.228; Received: by ewy28 with SMTP id 28so923764ewy.17 for ; Fri, 15 Jan 2010 08:43:18 -0800 (PST) Received: by 10.213.23.144 with SMTP id r16mr2659089ebb.41.1263573797893; Fri, 15 Jan 2010 08:43:17 -0800 (PST) Return-Path: Received: from ibc-laptop.localnet ([212.230.46.89]) by mx.google.com with ESMTPS id 24sm1643981eyx.38.2010.01.15.08.43.15 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 15 Jan 2010 08:43:16 -0800 (PST) From: =?iso-8859-1?q?I=F1aki_Baz_Castillo?= To: rack-devel@googlegroups.com Subject: Re: Trouble with Unicode in URLs Date: Fri, 15 Jan 2010 17:43:12 +0100 User-Agent: KMail/1.12.2 (Linux/2.6.28-16-generic; KDE/4.3.2; x86_64; ; ) References: In-Reply-To: MIME-Version: 1.0 Message-Id: <201001151743.12887.ibc@aliax.net> X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 209.85.219.228 is neither permitted nor denied by best guess record for domain of ibc@aliax.net) smtp.mail=ibc@aliax.net X-Original-Sender: ibc@aliax.net Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: X-Thread-Url: http://groups.google.com/group/rack-devel/t/b1083d6710b82f9a X-Message-Url: http://groups.google.com/group/rack-devel/msg/f75c30cadaaa0a29 Sender: rack-devel@googlegroups.com List-Unsubscribe: , List-Subscribe: , Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable El Viernes, 15 de Enero de 2010, Gaius escribi=F3: > I have a Rails app in which I'd like to use some Unicode URLs: >=20 > # in routes.rb: > map.resources 'proteges', :as =3D> 'prot=E9g=E9s', :only =3D> [:index] >=20 > When I go to http://localhost:3000/prot=E9g=E9s, I get >=20 > No route matches "/prot%C3%A9g%C3%A9s" with {:method=3D>:get} >=20 > That was on Mongrel, Unicode symbols are not allowed in URL according to its BNF grammar. So the= =20 client (the web browser in your case) hex-escapes these symbols. This is: the client is sending a request like: GET /prot%C3%A9g%C3%A9s HTTP/1.1 which is correct. Then the server must hex-unescape it, and this is what you do with your Rac= k=20 middleware :) Rack by itself doesn't require that the URL must be hex-unescaped before=20 passing then to the application, so if a task for your application to do it. > though I also tried Passenger. And the same happened? I don't think so as Apache unescapes the URL before= =20 passing the request to the backend (in this case mod_rack). I've checked it= =20 before: when a request with hex-escaped URL arrives to Apache it unescapes= =20 before passing the data to mod_rack so you get the Rack variables hex- unescaped (you should already see the unicode symbols). I wonder how is possible your Apache not to unescape the URL before passing= it=20 to Rack, could you please re-check it? which Apache version do you use? =2D-=20 I=F1aki Baz Castillo