I have found that a few files are not txt, but binary ones. I can open them with file:read-binary. However, the reference to XML can be confusing because I am not dealing with XML.
I think https://docs.basex.org/wiki/File_Module#file:read-text
suggests you can use
file:read-text("file.txt", "UTF-8", true)
and you won't get the error about invalid characters, instead the
returned string contains the Unicode
replacement character FFFD
On 12. Jan 2021, at 13:41, Martin Honnen <martin.honnen@gmx.de> wrote:
On 12.01.2021 13:33, Giuseppe G. A. Celano wrote:
Perhaps as XQuery strings impose XML rules for allowed characters? Can you read out the files as binary hex or base64?Hi,
I am trying to open a bunch of files with file:read-text, but I get the error [file:io-error] invalid XML character: #0, even I am not dealing with XML. Any idea why this happens? Thanks!