To Walter, about char[] initialization by FF

Walter Bright newshound at digitalmars.com
Sat Jul 29 19:22:55 PDT 2006


Andrew Fedoniouk wrote:
> "Walter Bright" <newshound at digitalmars.com> wrote in message 
> news:eagufo$2knt$1 at digitaldaemon.com...
>> Andrew Fedoniouk wrote:
>>> Element of UTF-8 sequence is an octet.  I think you should rename
>>> 'char' type to 'octet' if D/Phobos intended to support only UTF-8.
>> This was all hashed out years ago. It's too late to start renaming basic 
>> types.
> I am not asking to rename anything.

Ok, but you did say "I think you should rename..." <g>

> Could you please just remove this weird 0xFF initialization
> for char arrays? ( as it was prior to .162 buld )

char's have been initialized to 0xFF for years now, it was a bug that 
some array initializations didn't do it.

> This is the whole point. If you will do this
> then current char type can be used for
> representation of single byte encodings as it stands -
> character.

? I don't understand what's standing in the way of that now. And values 
from 0..7F are single byte UTF-8 encodings and can be stored in a char.

BTW, you can do this:

typedef char mychar = 0;

mychar[] a = new mychar[100];	// mychar[] will be initialized to 0



More information about the Digitalmars-d mailing list