3 ms·
That would make it impossible to edit non-ascii strings, like texts in foreign languages. As far as I know, most editors/IDE don't support switching fonts for s
by powersnail 2y ago
That would make it impossible to edit non-ascii strings, like texts in foreign languages. As far as I know, most editors/IDE don't support switching fonts for string literals. It is more feasible for a syntax highlighter to highlight non-ascii characters outside of literals.
- Someone 2y ago> As far as I know, most editors/IDE don't support switching fonts for string literals When asked to render an Unicode character that isn’t present in the font modern OSes will automatically pick a font that has it. https://en.wikipedia.org/wiki/Fallback_font https://en.wikipedia.org/wiki/Fallback_font: “A fallback font is a reserve typeface containing symbols for as many Unicode characters as possible. When a display system encounters a character that is not part of the repertoire of any of the other available fonts, a symbol from a fallback font is used instead. Typically, a fallback font will contain symbols representative of the various types of Unicode characters.” That can be avoided, for example by storing text as “one character per byte”, but I don’t think many editors do that nowadays.
- powersnail 2y agoBut that would not distinguish between chars inside a string literal and chars outside of a string literal.