Method: Beaker::Result#convert
- Defined in:
- lib/beaker/result.rb
#convert(string) ⇒ Object
34 35 36 37 38 |
# File 'lib/beaker/result.rb', line 34 def convert string # Remove invalid and undefined UTF-8 character encodings string.to_s.force_encoding('UTF-8') string.to_s.chars.select { |i| i.valid_encoding? }.join end |