Let's say I have this
file.md
UTF-8
Hello world
This text is encoded in UTF-8.
unparsed-text('file.md', 'UTF-8')
file2.md
Hello world
This character "ลก" is read like "sh" in english.
unparsed-text()
XTDE1200: Failed to read input file file:/C:/file2.md
(java.nio.charset.MalformedInputException): Input length = 1
file2.md
file.md
windows-1250
unparsed-text('file2.md', 'windows-1250')
As Martin says, the evidence you have provided suggests that the file is encoded in Windows-1252, and that unparsed-text('file.md', 'utf-8')
is therefore right to reject it.