string types: const(char)[] and cstring

Regan Heath regan at netmail.co.nz
Tue May 29 11:41:31 PDT 2007


Marcin Kuszczak Wrote:
> Regan Heath wrote:
> 
> > The default language/library support can reverse utf8 and 16 but it's not
> > ideal, eg.  convert to utf32, reverse, convert back. ;)
> > 
> > Regan
> 
> I am not sure what do you mean with this sentence... 
> 
> dstring implementation doesn't do things according to your description, so
> it's definitely not a case here...

I'm lost, what is "dstring"?

All I meant was that using std.utf you can say:

char[] text = "<characters which take more than 1 char to represent>";

text = toUTF8(toUTF32(text).reverse);

and the result will be a correctly reversed UTF8 string.  Or am I missing something?

Regan Heath



More information about the Digitalmars-d-announce mailing list