in reply to Detect wrong characters
When the encoding is set to iso-8859-1, the file can't possibly contain characters that aren't part of the iso-8859-1 character set (unless they are encoded using entities such as ਩).
Are you asking if it's possible to detect if the wrong encoding is specified? There's no way to detect whether it's invalid or not without using heuristics. For example, if byte sequence in the XML would form a word in iso-8859-7 but not in iso-8859-1, it could suggest that the wrong encoding was specified.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Detect wrong characters
by LexPl (Beadle) on Dec 02, 2024 at 15:26 UTC | |
by ikegami (Patriarch) on Dec 02, 2024 at 15:27 UTC |