Sha256: b1f2ca7794f629557aa2c9c98a65fa21ca50cc58867ac3ac4aa310741199ba27

Contents?: true

Size: 428 Bytes

Versions: 10

Compression:

Stored size: 428 Bytes

Contents

require 'pathname'

module Chronicle
  module ETL
    module Loaders
      module Helpers
        module EncodingHelper
          # Mostly useful for handling loading with binary data from a raw extraction
          def force_utf8(value)
            return value unless value.is_a?(String)

            value.encode('UTF-8', invalid: :replace, undef: :replace, replace: '')
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
chronicle-etl-0.6.1 lib/chronicle/etl/loaders/helpers/encoding_helper.rb
chronicle-etl-0.5.5 lib/chronicle/etl/loaders/helpers/encoding_helper.rb
chronicle-etl-0.5.4 lib/chronicle/etl/loaders/helpers/encoding_helper.rb
chronicle-etl-0.5.3 lib/chronicle/etl/loaders/helpers/encoding_helper.rb
chronicle-etl-0.5.2 lib/chronicle/etl/loaders/helpers/encoding_helper.rb
chronicle-etl-0.5.1 lib/chronicle/etl/loaders/helpers/encoding_helper.rb
chronicle-etl-0.5.0 lib/chronicle/etl/loaders/helpers/encoding_helper.rb
chronicle-etl-0.4.4 lib/chronicle/etl/loaders/helpers/encoding_helper.rb
chronicle-etl-0.4.3 lib/chronicle/etl/loaders/helpers/encoding_helper.rb
chronicle-etl-0.4.2 lib/chronicle/etl/loaders/helpers/encoding_helper.rb