Module: Chronicle::ETL::Loaders::Helpers::EncodingHelper
- Included in:
- Chronicle::ETL::Loader
- Defined in:
- lib/chronicle/etl/loaders/helpers/encoding_helper.rb
Instance Method Summary collapse
-
#force_utf8(value) ⇒ Object
Mostly useful for handling loading with binary data from a raw extraction.
Instance Method Details
#force_utf8(value) ⇒ Object
Mostly useful for handling loading with binary data from a raw extraction
9 10 11 12 13 |
# File 'lib/chronicle/etl/loaders/helpers/encoding_helper.rb', line 9 def force_utf8(value) return value unless value.is_a?(String) value.encode('UTF-8', invalid: :replace, undef: :replace, replace: '') end |