Replace utf-8 decoding

Previous implementation could be exploited to pass raw lines and
incorrectly handled invalid/partial messages