First Impressions
Georg Wrede
georg.wrede at nospam.org
Sun Oct 1 15:27:07 PDT 2006
BCS wrote:
> I may be just rambling but...
>
> how about have the type of the value denote the encoding. One for ASCII
> would only ever store ASCII (UTF-8 is invalid)
Then all Americans would use that instead of UTF-8.
This is natural, since first you code for yourself, later maybe for your
boss, etc. And, you'd only become aware of any problems when a Latino
tries to use his own name José, talk about Motörhead, or Anaïs the
fragrance. And the mail and newsreader you wrote in D simply would not work.
Guess if anybody would heed the warning "Only use this new ASCII
encoding when you are absolutely positive the program never will
encounter a single foreign sentence or letter".
So, better not.
---
D's current setup and documentation engourage this kind of suggestions,
and I don't blame you.
Things being like they are, a programmer who wants to write a crossword
puzzle generator, would of course begin with:
char[20][20] theGrid;
It's a shame that an otherwise so excellent language ( + the wording it
its docs) downright leads you to do this.
The guy naturally assumes that D being a "UTF-8" language, this would
work even in Chinese. (Hey, char[] foo = "José Motörhead from the band
Anaïs is on stage!"; works, so why wouldn't theGrid? Poor guy.
I can't blame anyone then wanting to stay within ASCII for the rest of
D's life.
More information about the Digitalmars-d
mailing list