Detect encoding for structured diffs and output UTF8