Thin UTF8 string wrapper

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Sat Dec 7 12:23:30 UTC 2019


On Saturday, 7 December 2019 at 03:23:00 UTC, Jonathan M Davis 
wrote:
> The module to look at here is std.utf, not std.encoding.

Hmmm, docs may need updating then -- several functions in 
`std.encoding` explicitly state they are replacements for 
`std.utf`.  Did you mean `std.uni`?

It is honestly a bit confusing which of these 3 modules to use, 
especially as they each offer different (and useful) tools.  For 
example, `std.utf.validate` is less useful than 
`std.encoding.isValid`, because it throws rather than returning a 
bool and giving the user the choice of behaviour.  `std.uni` 
doesn't seem to have any equivalent for either.

Thanks in any case for the as-ever characteristically detailed 
and useful advice :-)


More information about the Digitalmars-d-learn mailing list