Skip to content

Commit

Permalink
Implement escapeURIComponent in Java
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Nov 7, 2023
1 parent e3cfc39 commit b92bef8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ext/msgpack/packer_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,18 @@ static VALUE Packer_write_bin(VALUE self, VALUE obj)
return self;
}

static VALUE Packer_write_fragment(VALUE self, VALUE obj)
{
msgpack_packer_t *pk = MessagePack_Packer_get(self);
Check_Type(obj, T_STRING);

VALUE enc = rb_enc_from_encoding(rb_ascii8bit_encoding());
obj = rb_str_encode(obj, enc, 0, Qnil);

msgpack_packer_write_string_value(pk, obj);
return self;
}

static VALUE Packer_write_array(VALUE self, VALUE obj)
{
msgpack_packer_t *pk = MessagePack_Packer_get(self);
Expand Down

0 comments on commit b92bef8

Please sign in to comment.