Class: Datanorm::Helpers::Utf8

Inherits:
Object
  • Object
show all
Includes:
Calls
Defined in:
lib/datanorm/helpers/utf8.rb

Overview

Converts a String to UTF-8.

Instance Method Summary collapse

Instance Method Details

#callObject

I sometimes encounter single spaces to indicate nil in Datanorm. So let's filter out those, too.



13
14
15
16
17
# File 'lib/datanorm/helpers/utf8.rb', line 13

def call
  return if input.nil? || input == ' ' || input.to_s.empty?

  input.to_s.encode('UTF-8')
end