Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding ISO-8859-1 is not supported #105

Closed
alexismanuel opened this issue Nov 8, 2024 · 0 comments
Closed

Encoding ISO-8859-1 is not supported #105

alexismanuel opened this issue Nov 8, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@alexismanuel
Copy link

Problem Statement
xq fails to parse XML files that use ISO-8859-1 encoding when piping content through the command line using cat. The tool lacks support for non-UTF-8 character encodings, specifically throwing an error when encountering ISO-8859-1 encoded XML files.

Steps to Reproduce

  1. Create a test XML file (test.xml) with the following content:
<?xml version="1.0" encoding="ISO-8859-1"?>
<a>toto</a>

Run the command:

cat test.xml | xq -x /a

Actual Result
The command fails with the following error:

Error: xml: encoding "ISO-8859-1" declared but Decoder.CharsetReader is nil

Expected Result
The command should successfully parse the XML file and output:
toto

The error suggests that the XML decoder lacks the necessary character set reader implementation to handle ISO-8859-1 encoding. This should either be supported directly or the tool should provide clear documentation about supported encodings and potential workarounds for users dealing with non-UTF-8 encoded XML files.

@alexismanuel alexismanuel added the bug Something isn't working label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants