ruby-gpgme
ruby-gpgme copied to clipboard
Fix UTF-8 encoding in gpgdata write callback
This change associates the buffer allocated in the gpgme_data write callback with the UTF-8 encoding. If there is a configured internal encoding (e.g. Encoding.default_internal), then the string is exported to that encoding.
This fixes this bug: https://github.com/ueno/ruby-gpgme/issues/113
Probably would want to consider in the future unifying the encoding logic used in utf8_str_new
and the logic added in this PR to work the same way -- users would probably be happy if they could set their own internal encoding that would affect both code paths.
Coverage increased (+0.06%) to 90.518% when pulling 5eb45139617f33daaca421c5226ff2e6e9e91598 on computology:utf8_cb into 387c77585909e73773d1c97a782667f951cda67d on ueno:master.
This fixes https://github.com/ueno/ruby-gpgme/issues/113
Hi 👋 any news on getting this merged in?