Search code examples
special-charactersdelimiterseparatorplaintext

Is there a special character that cannot be typed or copied by user, but can be inserted/read by code into/from text?


I need to have a temporary delimiter, inserted server-side, that cannot possibly exist in content created by user.

The purpose for this is to have prepared content for CSV export, with configurable value delimiter, that will replace this untypeable character client-side, right before the export.

Does such character even exist?


Solution

  • There is no character that cannot possibly exist; however there are many characters (in particular control codes - those lower than decimal 32, excluding cr/lf/tab) that are extremely unlikely to exist in any reasonable text content. This is why escaping is often required in text-based protocols. There is no reserved space of characters that will be escaped in CSV, other than those already used in CSV itself.