Sha256: fc27cc4588233f3b66686c21e97e386c439fde102bec840d245bf721c929abff

Contents?: true

Size: 334 Bytes

Versions: 7

Compression:

Stored size: 334 Bytes

Contents

require 'iconv'

module Rollbar
  class LegacyEncoder
    attr_accessor :object

    def initialize(object)
      @object = object
    end

    def encode
      value = object.to_s
      encoded_value = ::Iconv.conv('UTF-8//IGNORE', 'UTF-8', value)

      object.is_a?(Symbol) ? encoded_value.to_sym : encoded_value
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rollbar-2.2.0 lib/rollbar/encoding/legacy_encoder.rb
rollbar-2.1.2 lib/rollbar/encoding/legacy_encoder.rb
rollbar-2.1.1 lib/rollbar/encoding/legacy_encoder.rb
rollbar-2.1.0 lib/rollbar/encoding/legacy_encoder.rb
rollbar-2.0.2 lib/rollbar/encoding/legacy_encoder.rb
rollbar-2.0.1 lib/rollbar/encoding/legacy_encoder.rb
rollbar-2.0.0 lib/rollbar/encoding/legacy_encoder.rb