]> git.openstreetmap.org Git - rails.git/blobdiff - config/initializers/router.rb
Merge branch 'master' into HEAD
[rails.git] / config / initializers / router.rb
diff --git a/config/initializers/router.rb b/config/initializers/router.rb
new file mode 100644 (file)
index 0000000..4357a87
--- /dev/null
@@ -0,0 +1,14 @@
+# 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)