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
gojq -nr '["\u0000"] | @tsv' #200
Comments
Please let me know if any application that recognize |
That's not quite the right question. The point is that a TSV file should be processable by tools that are NOT well-disposed to NULs:
|
So, there is no way to deal with NUL characters properly, and we should not use it in the input for the filters. Rather than making it indistinguishable against |
Hmm, I'd rather reject them by errors. |
@itchyny wrote:
But, when generating a TSV file, special characters (notably tabs, linefeeds, and returns) must be handled sensibly, and I believe, the same logic applies to NULs as well. Agreed, there is no "TSV standard" that mandates allowing raw NULs in a TSV file, but (a) there are plenty of applications which recognize the two-character sequences '\t', '\r', '\r' and '\0' as stand-ins; and (b) in the present context, jq itself establishes a time-tested and reasonable standard. |
Okay, I noticed that the escaped character is escaped in |
Compare:
and the output produced by gojq:
In 2015, there was discussion about what jq should do with NUL and
even though it may not be documented in the manual, the decision
to present NUL as \0 by @TSV was part of the discussion at
jqlang/jq#759
The text was updated successfully, but these errors were encountered: