ueno / ruby-gpgme

a ruby interface to GnuPG Made Easy (GPGME).
GNU Lesser General Public License v2.1
232 stars 99 forks source link

Fix UTF-8 encoding in gpgdata write callback #118

Open ice799 opened 6 years ago

ice799 commented 6 years ago

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 commented 6 years ago

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.

coveralls commented 6 years ago

Coverage Status

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

ice799 commented 6 years ago

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

tommeier commented 9 months ago

Hi 👋 any news on getting this merged in?