Sha256: a2fec3945497c847f9b269154a41431d5f3e1c76c5036ec346a88fda5645e30a

Contents?: true

Size: 312 Bytes

Versions: 38

Compression:

Stored size: 312 Bytes

Contents

require 'protobuf/field/bytes_field'

module Protobuf
  module Field
    class StringField < BytesField
      ENCODING = 'UTF-8'.freeze

      def decode(bytes)
        bytes.force_encoding(::Protobuf::Field::StringField::ENCODING) if bytes.respond_to?(:force_encoding)
        bytes
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
protobuf-2.4.3.rc1 lib/protobuf/field/string_field.rb
protobuf-2.4.2-java lib/protobuf/field/string_field.rb
protobuf-2.4.2 lib/protobuf/field/string_field.rb
protobuf-2.4.1-java lib/protobuf/field/string_field.rb
protobuf-2.4.1 lib/protobuf/field/string_field.rb
protobuf-2.4.0-java lib/protobuf/field/string_field.rb
protobuf-2.4.0 lib/protobuf/field/string_field.rb
protobuf-2.3.2-java lib/protobuf/field/string_field.rb
protobuf-2.3.2 lib/protobuf/field/string_field.rb
protobuf-2.3.1-java lib/protobuf/field/string_field.rb
protobuf-2.3.1 lib/protobuf/field/string_field.rb
protobuf-2.3.0-java lib/protobuf/field/string_field.rb
protobuf-2.3.0 lib/protobuf/field/string_field.rb
protobuf-2.2.7-java lib/protobuf/field/string_field.rb
protobuf-2.2.7 lib/protobuf/field/string_field.rb
protobuf-2.2.6-java lib/protobuf/field/string_field.rb
protobuf-2.2.6 lib/protobuf/field/string_field.rb
protobuf-2.2.5-java lib/protobuf/field/string_field.rb
protobuf-2.2.5 lib/protobuf/field/string_field.rb
protobuf-2.2.4 lib/protobuf/field/string_field.rb