Split data into lines before decoding to strings

Will prevent mangling when a chunk ends partway through a multibyte character.