Wonder if there is any interest in being able to write a literal ustring that may contain embedded non-UTF16 friendly bytes? I was thinking that if you provide a parser for a FormattableString, you can use some Format Item format code to intermix literal character strings with raw bytes.
Something like:
var us = ustring.Make($"Sample {0xff::} Embedded");
This would yield a ustring (us) with the content:
| Char |
Byte |
| 'S' |
83 |
| 'a' |
97 |
| 'm' |
109 |
| 'p' |
112 |
| 'l' |
108 |
| 'e' |
101 |
| ' ' |
32 |
| ff |
255 |
| ' ' |
32 |
| 'E' |
69 |
| 'm' |
109 |
| 'b' |
98 |
| 'e' |
101 |
| 'd' |
100 |
| 'd' |
100 |
| 'e' |
101 |
| 'd' |
100 |