Forums » Saxon/C Help and Discussions »
java.io.UnsupportedEncodingException: Cp1252
Added by Stephan Bielmann 8 months ago
Hello All,
working with version 12.4.2 on Linux and having this simplified C++ code to explain what I do:
SaxonProcessor *processor = new SaxonProcessor(true);
Xslt30Processor *trans = processor->newXslt30Processor();
XsltExecutable *executable = executable = trans->compileFromFile("/tmp/test.xsl");
executable->setInitialMatchSelectionAsFile("/tmp/file.xml");
const char *output = executable->applyTemplatesReturningString();
My file.xml header is like this:
<?xml version="1.0" encoding="windows-1252" standalone="no"?>
I get the following exception running my program:
SXXP0003 I/O error reported by XML parser processing
file:///tmp/file1.xml. Caused by
java.io.UnsupportedEncodingException: Cp1252
My Linux its locale is en_US.UTF-8. Using XML files with utf-8 or iso-8859-1 encodings all work fine.
The same program and input files with windows-1252 encoding on Windows work though. I face this problem only on Linux.
Any help appreciated.
Thanks, Stephan
Replies (1)
RE: java.io.UnsupportedEncodingException: Cp1252 - Added by Matt Patterson 8 months ago
Thank you for reaching out.
This definitely looks like a bug, but can you give me some more information about the version of Linux you're using? It'd be good to know what distro and version, and the processor architecture (x86_64 or ARM) you're running on.
I've opened an issue for it here: https://saxonica.plan.io/issues/6372
Thanks,
Matt
Please register to reply