From 0b9bf8d816902f969bac5b522c18067ad06df445 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 22 Jul 2014 15:13:36 +0100 Subject: [PATCH] Force the path to be treated as UTF-8 --- config/initializers/router.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 config/initializers/router.rb diff --git a/config/initializers/router.rb b/config/initializers/router.rb new file mode 100644 index 000000000..a1e6bbf38 --- /dev/null +++ b/config/initializers/router.rb @@ -0,0 +1,18 @@ +# Some versions of ruby seem to accidentally force the encoding +# as part of normalize_path and some don't + +module ActionDispatch + module Journey + class Router + class Utils + def self.normalize_path_with_encoding(path) + self.normalize_path_without_encoding(path).force_encoding("UTF-8") + end + + class << self + alias_method_chain :normalize_path, :encoding + end + end + end + end +end -- 2.43.2