5 ms·
You know, why don't we use 0x1F (Unit Separator)? Seems like we have had a hierarchical delimiters since ASCII / punch cards, yet I never hear about them. https
by Darkphibre 6y ago
You know, why don't we use 0x1F (Unit Separator)? Seems like we have had a hierarchical delimiters since ASCII / punch cards, yet I never hear about them.
https://en.wikipedia.org/wiki/C0_and_C1_control_codes#Field_separators https://en.wikipedia.org/wiki/C0_and_C1_control_codes#Field_...
CSVs are such a pain if you have freeform text (in which you have to handle newlines and escaped quotes).
It seems like using FS/GS/RS/US from the C0 control codes would be divine (provided there was implicit support for viewing/editing them in a simple text editor). I get that it's a non-printable control character, and thus not traditionally rendered... but that latter point could have been done ages ago as a standard convention in editors (enter VIM et. al., as they will indeed allow you to see them).
- jimmaswell 6y agoIt's nice being able to edit a CSV in a text editor. It wouldn't be worth it to lose that just to not have to escape some strings.
- afiori 6y agomore than that it is nice to edit files with a standard keyboard,
- db48x 6y agoIf your editor doesn't allow you to enter arbitrary characters using a standard keyboard then you need a better editor.
- chousuke 6y agoThe problem is not the editor, it's the human typing on the keyboard that sees , and thinks "that'll do". Using an obscure dedicated character is not going to happen.
- Darkphibre 6y agoI guess my point was a curiosity that these control codes had become obscure, when text format interchange is so prevalent throughout computing history.
- afiori 6y agoI do not want to learn new input methods for every program, I want a standardized compose-like functionality that allow me to write both diacritics and backticks ( a plus for the rest of unicode)
- db48x 6y agoAll operating systems have that too. Look up "Input Method Editor" in your favorite OS's documentation. See also dead keys, compose key, AltGr, etc, etc. If you think you can't edit a file because it has funny characters in it, then you're not trying hard enough.
- afiori 6y agoI know, still there is no reasonable way* to do both common european diacritics and backticks/tilde on windows without installing third-party software. * I find dead keys irritating beyond reason, so I do not count them as an option
- deleted 6y ago[deleted]
- sp332 6y agoIt wouldn't take that much effort to add a glyph in the editor for it?
- JdeBP 6y agoText editors that can put control characters into files, and indeed PC keyboards that have a [Control] key, have been around for decades, though. For example: With WordStar, SideKick, and Microsoft's EDIT, one just typed [Control]+[P] and then the control character. M. Darkphibre mentioned VIM, but really this isn't an idea that was ever limited to just VIM and emacs.
- 0xbadcafebee 6y agoThere are plenty of ways a lazy programmer will want to pass the records into something else that either doesn't handle non-printables, or does but the user doesn't like how it looks. TSV also works more reliably than CSV, because most people don't put tab characters in the data in these kinds of records. Tab is even the default field delimiter for cut. But everybody uses CSV, because again it's easier to reason about the above. (shrug)
- nitrogen 6y agoNo matter what delimiters we use, we still have either a data sanitization problem or a data escaping problem. I've worked with a wire protocol that used the ASCII record delimiters, but with binary data so you also had to use binary escape (0x1b) and set the eighth bit on the following byte.