Message length doesn't include newline, adjust encoding and fix test. Test input character by character