aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/multibyte/utils.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/multibyte/utils.rb')
-rw-r--r--activesupport/lib/active_support/multibyte/utils.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/multibyte/utils.rb b/activesupport/lib/active_support/multibyte/utils.rb
index acef84da91..8e47763d39 100644
--- a/activesupport/lib/active_support/multibyte/utils.rb
+++ b/activesupport/lib/active_support/multibyte/utils.rb
@@ -5,7 +5,7 @@ module ActiveSupport #:nodoc:
if Kernel.const_defined?(:Encoding)
# Returns a regular expression that matches valid characters in the current encoding
def self.valid_character
- VALID_CHARACTER[Encoding.default_internal.to_s]
+ VALID_CHARACTER[Encoding.default_external.to_s]
end
else
def self.valid_character
@@ -27,7 +27,7 @@ module ActiveSupport #:nodoc:
def self.verify(string)
if expression = valid_character
for c in string.split(//)
- return false unless valid_character.match(c)
+ return false unless expression.match(c)
end
end
true
@@ -50,7 +50,7 @@ module ActiveSupport #:nodoc:
def self.clean(string)
if expression = valid_character
stripped = []; for c in string.split(//)
- stripped << c if valid_character.match(c)
+ stripped << c if expression.match(c)
end; stripped.join
else
string
@@ -58,4 +58,4 @@ module ActiveSupport #:nodoc:
end
end
end
-end \ No newline at end of file
+end