What's left for 1.0?
Nahon
nahon at t-online.hu
Fri Nov 17 08:17:51 PST 2006
Marcin Kuszczak wrote:
> I think that one thing which is missed in phobos right now is string class
> which encapsulates utf-8/utf-16/utf-32 handling and issues connected with
> utf-8 strings e.g.:
>
> char[] foo = "hög";
> assert(foo.length == 3); // Sorry UTF-8, this is == 4
> assert(foo[1] == 'ö'); // Not a chance!
My Win version doesn't even start to parse the source file if an ASCII
>127 character is present even if it is in a comment!
If I create an a.d (ö is #f6):
void main()
{
//hög
}
And then run:
$ dmd a
The result is:
a.d(3): invalid UTF-8 sequence
I think that would be nice to somehow tell the parser which format is
the source file. It could be a command line parameter
-encoding:ANSI|UTF-8|etc.
or the first line of the file should contain that like
//!Encoding: ANSI
Regards,
Nahon
More information about the Digitalmars-d
mailing list