Web console: allow encoding of ASCII control chars#10795
Web console: allow encoding of ASCII control chars#10795vogievetsky merged 10 commits intoapache:masterfrom
Conversation
|
How did you pick this one? Neither JSON nor Java support References:
IMO matching what JSON does would make the most sense to people, since the underlying API is a JSON one. |
|
I am only escaping char codes 0 to 0x1f so |
|
Are there chars outside of 0 to 0x1f that should be encoded if we do |
I don't think it's about overkill / underkill but more what people will expect. The underlying APIs are JSON so IMO it is best if the web console accepts JSON style escapes.
It's a C thing. I think we can skip it. It's only supported by Java, anyway, not JSON, and I think it makes more sense to stick to JSON.
I would accept exactly what JSON does, no more & no less:
That way, people can copy stuff freely back and forth between JSON specs and the web console fields. Note: the way unicode characters outside BMP are encoded here is not universal; for example Python would encode 🙂 as |
|
Ok that seems like a plan. I could actually use the JSON stringier / parser itself and it would be super robust and guaranteed to follow the JSON spec by definition. I would make only one exception to the "no more & no less" rule: Since this input would always be parsed in a string context I would allow a single unescaped Meaning |
I think that would be OK, it makes sense to me. It breaks the 'freely copy back and forth' principle but in a very reasonable way. It will probably decrease the overall level of surprise for users. |
|
@gianm I updated the PR per your suggestions |
* allow encoding of ascii control chars * change to JSON * make json escpaes work * update snapshot * break out component * fix test * update test script * update formatter to be more chill
This PR makes it possible to input ASCII control chars through the web console UI by writing them as
\x??notation just like you can do in many languages inside of string literals.This allows the
delimiterandlistDelimiterinputs to actually be useful in the parse data screen.