Encoding & Line Endings¶
When Diffract opens a text file it automatically detects the character encoding and line-ending style. The result is shown in the encoding bar - a thin strip at the bottom of the comparison view, below the panels.
The Encoding Bar¶
The encoding bar shows two pieces of information for each side:
- Encoding - the detected (or overridden) character encoding, for example
UTF-8orLatin-1. - Line endings - the style detected in the file:
LF,CRLF,CR, orMixed(when more than one style is present).
The bar only appears when at least one side is a text file.
Auto-Detection Order¶
For each file, Diffract tries encodings in the following order and uses the first one that produces valid output:
- UTF-8
- UTF-16 LE (detected via BOM)
- UTF-16 BE (detected via BOM)
- Latin-1 - accepted for any byte sequence as a fallback
Overriding the Encoding¶
If the auto-detected encoding is wrong (a common sign is garbled or replacement characters in the comparison), you can force a different encoding:
- Click the encoding label on the side you want to change.
- A dropdown appears with the available options: Auto, UTF-8, UTF-16 LE, UTF-16 BE, and Latin-1.
- Select the encoding you want. The file is re-read immediately with the chosen encoding and the comparison re-runs.
Selecting Auto restores auto-detection for that side.
Note
The encoding override applies to text interpretation only. It does not change which comparison view opens (text, hex, image, etc.) - that is determined by the file extension and content type.
Line Endings¶
The detected line-ending style is displayed next to the encoding label but cannot be overridden directly. To make Diffract treat CRLF and LF as identical when computing the diff, use the ΒΆ toggle in the comparison options bar.
See Ignore Options for details.