FIX: scrub freedom_patch should take the optional replacement_char argument. Mysql2::Error uses it. mysql2 is used by some import scripts.

This commit is contained in:
Neil Lalonde 2014-07-03 11:11:21 -04:00
parent 7ac4372427
commit a4a90475cf
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
class String
# A poor man's scrub, Ruby 2.1 has a much better implementation, but this will do
unless method_defined? :scrub
def scrub
def scrub(replace_char=nil)
str = dup.force_encoding("utf-8")
unless str.valid_encoding?