ruby-gpgme icon indicating copy to clipboard operation
ruby-gpgme copied to clipboard

Fix UTF-8 encoding in gpgdata write callback

Open ice799 opened this issue 6 years ago • 4 comments

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.

ice799 avatar Jun 30 '18 16:06 ice799

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.

ice799 avatar Jun 30 '18 16:06 ice799

Coverage Status

Coverage increased (+0.06%) to 90.518% when pulling 5eb45139617f33daaca421c5226ff2e6e9e91598 on computology:utf8_cb into 387c77585909e73773d1c97a782667f951cda67d on ueno:master.

coveralls avatar Jun 30 '18 17:06 coveralls

This fixes https://github.com/ueno/ruby-gpgme/issues/113

ice799 avatar Jul 02 '18 17:07 ice799

Hi 👋 any news on getting this merged in?

tommeier avatar Feb 26 '24 23:02 tommeier