First Impressions

Chad J "gamerChad\" at spamIsBad gmail.com
Fri Sep 29 13:03:23 PDT 2006


Georg Wrede wrote:
> The secret is, there actually is a delicate balance between UTF-8 and 
> the library string operations. As long as you use library functions to 
> extract substrings, join or manipulate them, everything is OK. And very 
> few of us actually either need to, or see the effort of bit-twiddling 
> individual octets in these "char" arrays.
> 

But this is what I'm talking about... you can't slice them or index 
them.  I might actually index a character out of an array from time to 
time.  If I don't know about UTF, and I do just keep on coding, and I do 
something like this:

char[] str = "some string in nonenglish text";
for ( int i = 0; i < str.length; i++ )
{
   str[i] = doSomething( str[i] );
}

and this will fail right?

If it does fail, then everything is not alright.  You do have to worry 
about UTF.  Someone has to tell you to use a foreach there.



More information about the Digitalmars-d mailing list