2 ms·
> C sort of assumes all strings are ASCII How so? Concerning runtime values, you can do whatever you want in C, which means UTF-8 support in C is basically fre
by jstimpfle 8y ago
> C sort of assumes all strings are ASCII
How so? Concerning runtime values, you can do whatever you want in C, which means UTF-8 support in C is basically free. Note that UTF-8 was explicitly designed to have this kind of upward compatibility.
Concerning string literals, just keep your source files encoded in UTF-8 and put in quotes the UTF-8 string you want to process at runtime. I'm not aware how the spec handles source code files that are not ASCII, but in practice it works, and furthermore you can always opt for hex escapes.
- deleted 8y ago[deleted]