Fix for newer Rubies where you cannot #force_encoding on a frozen string.

pull/8850/head
Joshua Haberman 3 years ago
parent e2360d768f
commit cb649b61e3
  1. 2
      ruby/lib/google/protobuf/descriptor_dsl.rb

@ -376,7 +376,7 @@ module Google
default = default.to_s
end
# XXX: we should be C-escaping bytes defaults.
field_proto.default_value = default.force_encoding("UTF-8")
field_proto.default_value = default.dup.force_encoding("UTF-8")
end
if options.key?(:json_name)
field_proto.json_name = options[:json_name]

Loading…
Cancel
Save