views:

41

answers:

2

Hi,

I just upgraded Rails to 2.3.4. Before the upgrade rails was ok with international characters in urls, but it isn't working anymore.

How do I get the following to work with rails 2.3.4:

ActionController::Routing::Routes.draw do |map|
    ...
    map.connect 'ö', :controller => 'test'
    ...
end

If I change 'ö' to 'o' it works, but thats not what I want.

Thanks, Peder

A: 

CGI::escape seems like a quick fix to me.

ActionController::Routing::Routes.draw do |map|
  map.connect CGI::escape("ö"), :controller => 'test'
end
Bryan Woods
A: 

Thanks Bryan! It works. How do I mark the question as answered? I posted the question while not logged in.

Peder
Glad it worked! There should be a check mark by the up and down vote arrows next to my answer. Checking it will mark the question as answered.
Bryan Woods
Actually this doesn't work because CGI::escape( 'ö' ) => "%C3%B6" but some browsers translate ö to "%c3%b6". So you would have to add CGI::escape( 'ö' ).downcase as well. There must be a better solution to this.
Peder