Writer wasn't using the correct encoding, this commit fixes this problem