strings and ranges

anonymous anonymous at example.com
Wed Aug 14 18:00:38 PDT 2013


On Thursday, 15 August 2013 at 00:49:00 UTC, Jason den Dulk wrote:
> When working with my code I noticed that if I use front on a 
> char[], it yields a dchar. Am I correct in concluding that it 
> does a UTF-8 to UTF-32 conversion and popFont will skip the 
> whole character, not just a code unit?

yup

> Also, does this mean that if I'm creating an output range for 
> char[], will I need to implement a put(dchar) as well as a 
> put(char)?

I think you don't need put(char). put(char[]) or 
put(const(char)[]) could be worthwhile to prevent decoding. But 
put(dchar) alone would suffice.


More information about the Digitalmars-d-learn mailing list