openstreetmap-website/config/initializers/router.rb
Tom Hughes f8f7054fc2 Move monkey patch modules to the OpenStreetMap namespace
Having them in the OSM namespace risks blocking autoloading
of the lib/osm.rb code by defining the OSM constant.
2017-06-02 16:33:27 +01:00

14 lines
375 B
Ruby

# Some versions of ruby seem to accidentally force the encoding
# as part of normalize_path and some don't
module OpenStreetMap
module Router
module ForceEncoding
def normalize_path(path)
super(path).force_encoding("UTF-8")
end
end
end
end
ActionDispatch::Journey::Router::Utils.singleton_class.prepend(OpenStreetMap::Router::ForceEncoding)