Hacker News new | ask | show | jobs
by eviks 414 days ago
> there would be a need to have a visible representation for them in the terminal, and a way to enter RS on the keyboard.

Both already possible, they have official symbols representing them

> Then, one day somebody would need to store one of those strings in a table, and there would be no way to do so without escaping.

Why? But also, yes, escaping also exists, just like in the alternative formats

1 comments

> Both already possible, they have official symbols representing them.

I'm not sure what you mean. For an illustration, my terminal does not print anything for them.

    $ printf "qq\36\37text\n"
    qqtext
*Update/Aside:* "My terminal", in this case, was `tmux`. Ghostty, OTOH, prints spaces instead of RS or US.

Unicode does have some symbols for every non-printable ASCII character, which you can see as follows with https://github.com/sharkdp/bat (assuming your font has the right characters, which it probably does):

    $ printf "qq\36\37text\n" | bat -A --decorations never
    qq␞␟text␊
Here, `␞` is https://www.compart.com/en/unicode/U+241E, one of the symbols for non-printable characters that Unicode has; different fonts display it differently. See also https://www.compart.com/en/unicode/block/U+2400.

Is there some better representation it has?

Yes, I did mean the ␞ U+241E unicode symbols that represent separators. And as your `| bat` example shows, they can also be displayed in the terminal.

If you meant the default should always be symbolic, not sure, like newline separator isn't displayed in the terminal as a symbol, but maybe that's just a matter of extra terminal config