faljse / SDNotify

SDNotify implements the systemd notification protocol in Java.
GNU Lesser General Public License v2.1
58 stars 18 forks source link

String encoding is not correct #6

Closed cosenmarco closed 5 years ago

cosenmarco commented 5 years ago

According to comment https://github.com/faljse/SDNotify/blob/f7c895d0a6baf023be5b2aa83041d1a49bbde80c/src/main/java/info/faljse/SDNotify/SDNotify.java#L94 the string sent to SystemD is encoded in UTF-8 but according to line https://github.com/faljse/SDNotify/blob/f7c895d0a6baf023be5b2aa83041d1a49bbde80c/src/main/java/info/faljse/SDNotify/SDNotify.java#L193 the encoding used is US-ASCII.

I think the encoding should be adjusted to UTF-8 because of the SystemD expectation being UTF-8 (as correctly stated in the comment) which is also documented in https://www.freedesktop.org/software/systemd/man/sd_notify.html

cosenmarco commented 5 years ago

Thanks!