D Conference Tango Phobos

Steven Schveighoffer schveiguy at yahoo.com
Fri Sep 14 07:57:16 PDT 2007


"Regan Heath" <regan at netmail.co.nz> wrote in message 
news:fce6je$1qe2$1 at digitalmars.com...
> Steven Schveighoffer wrote:
>> To me, I think toString is more clear.  BTW, I think utf-8 has multi-byte 
>> characters.  If that's the case, then isn't toASCII more appropriate?
>
> Are you saying that the object to<whatever> routine should output ASCII 
> and not UTF-8, 16, or 32?  If so, I doubt the japanese D community would 
> agree. <g>

I understand, but first, I KNOW that in my objects that I override toUtf8, 
I'm outputting only ASCII.  I'm not saying that all objects in the library 
do, but I'm guessing that many people do this.

Then it becomes a question of how to interpret the fact that the name is 
toUtf8.  Is it reasonable for a Japanese developer to assume that because 
his locale is set differently, all toUtf8 methods should return strings in 
Japanese, and to do otherwise is a bug?  The name implies that to me, and so 
that is why I think it's misleading.  It also implies that it is the 
responsibility of everyone who overrides that method to take care if i18n. 
Not something I wish to do when I'm probably only going to use toUtf8 as a 
debugging mechanism :)

-Steve 





More information about the Digitalmars-d mailing list