Some questions about strings

Adam D. Ruppe destructionator at gmail.com
Mon Jun 22 03:49:01 UTC 2020


On Monday, 22 June 2020 at 03:43:58 UTC, Denis wrote:
> My code reads a UTF-8 encoded file into a buffer and validates, 
> byte by byte, the UTF-8 encoding along with some additional 
> validation. If I simply return the UTF-8 encoded string, there 
> won't be another decoding/encoding done -- correct?

Yeah D doesn't do extra work when you are just passing stuff 
around, only when you specifically ask for it by calling a 
function or maybe doing foreach (depends on if you ask for char 
or dchar in the foreach type)


More information about the Digitalmars-d-learn mailing list