Permalink
Browse files

Force utf8 encoding

  • Loading branch information...
1 parent a2212aa commit 017c11225091065895de5b98b60a2bd898b32763 @methodmissing committed Jun 14, 2009
Showing with 2 additions and 3 deletions.
  1. +2 −3 lib/fuzz/token.rb
View
@@ -95,11 +95,10 @@ def pattern
# return a regex object to match
# incoming strings against
- Regexp.compile(rx, Regexp::IGNORECASE )
+ Regexp.compile(rx.force_encoding("utf-8"), Regexp::IGNORECASE )
end
def match(str)
-
# perform the initial match by comparing
# the string with this classes regex, and
# abort if nothing matches
@@ -186,7 +185,7 @@ def extract(str)
def extract!(str)
-
+ str.force_encoding("utf-8")
# call Token#extract first,
# and abort it if failed
ext = extract(str)

0 comments on commit 017c112

Please sign in to comment.