Method: String#fix_encoding_errors!

Defined in:
lib/name_tamer/string.rb

#fix_encoding_errors!Object

Strings that were wrongly encoded with single-byte encodings sometimes have tell-tale substrings that we can put back into the correct UTF-8 character



74
75
76
# File 'lib/name_tamer/string.rb', line 74

def fix_encoding_errors!
  gsub!(BAD_ENCODING_PATTERNS) { |substring| BAD_ENCODING[substring] || substring } || self
end