Can I give C0 and C1 control codes custom meanings?

  softwareengineering

Unicode treats C0 and C1 control codes as valid characters. But I’ve never seen them explicitly used in programming languages, apart from whitespaces such as n.

So as far as I’ve experienced, the supposed “meanings” of the control codes are just legacies of old I/O devices, and are mostly irrelevant to current hardwares.

On the other hand, if that’s the case, I could give custom meanings to the control code. For examples:

  • An operating system could have only one input stream and one output stream at the back-end, and the control codes passing the streams shall decide which device is actually doing the I/O.

  • In a programming language, regexes could map their metacharacters into a control code.

I’m actually willing to build such things, but what advantages would I gain by doing so? What are the caveats?

New contributor

Dannyu NDos is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT