aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-04-26 11:50:18 -0300
committerJeremy Kemper <jeremy@bitsweat.net>2010-04-26 14:45:23 -0700
commit76d6a993647f3bbe39f31faa0b8ed8767a228301 (patch)
tree2c1e54176028be140065828ebf40cb2835b674eb /activesupport/lib
parent53c13f1acaa2eb05e7f418b53f6156a4f5a773e0 (diff)
downloadrails-76d6a993647f3bbe39f31faa0b8ed8767a228301.tar.gz
rails-76d6a993647f3bbe39f31faa0b8ed8767a228301.tar.bz2
rails-76d6a993647f3bbe39f31faa0b8ed8767a228301.zip
Use explicit source encoding rather than forced UTF-8 from US-ASCII.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/core_ext/uri.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/core_ext/uri.rb b/activesupport/lib/active_support/core_ext/uri.rb
index ca1be8b7e9..28eabd2111 100644
--- a/activesupport/lib/active_support/core_ext/uri.rb
+++ b/activesupport/lib/active_support/core_ext/uri.rb
@@ -1,8 +1,9 @@
+# encoding: utf-8
+
if RUBY_VERSION >= '1.9'
require 'uri'
str = "\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E" # Ni-ho-nn-go in UTF-8, means Japanese.
- str.force_encoding(Encoding::UTF_8) if str.respond_to?(:force_encoding)
parser = URI::Parser.new
unless str == parser.unescape(parser.escape(str))