decode encoded string chunks properly