string types: const(char)[] and cstring

Aziz K. aziz.kerim at gmail.com
Tue May 29 12:24:35 PDT 2007


On Tue, 29 May 2007 20:41:31 +0200, Regan Heath <regan at netmail.co.nz>  
wrote:
> and the result will be a correctly reversed UTF8 string.  Or am I  
> missing something?
>
> Regan Heath

I think your method doesn't take compound characters into account.

For example:
// The accented é can be represented by a single code-point. But let's  
assume it's a compound character (Ce`a).
writefln( toUTF8(toUTF32("Céa").reverse) ) // would reverse to a`eC
// This would print áeC



More information about the Digitalmars-d-announce mailing list