First Impressions

Georg Wrede georg.wrede at nospam.org
Fri Sep 29 12:40:26 PDT 2006


Chad J > wrote:
> I will go ahead and say that the current state of char[] is incorrect. 
> That is, if you write a program manipulating char[] strings, then run it 
> in china, you will be dissapointed with the results.  It won't matter 
> how fast the program runs, because bad stuff will happen like entire 
> strings becoming unreadable to the user.

Wrong.

And that's precisely what I meant about the Daddy holding bike allegory 
a few messages back.

The current system seems to work "by magic". So, if you do go to China, 
itll "just work".

At this point you _should_ not believe me. :-) But it still works.

---

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.

So things just keep on working.

---

Not convinced yet? Well, a lot of folks here are from Europe, and our 
languages contain "non-ASCII" characters. Our text manipulating programs 
still work allright. And, actually D is pretty popular in Japan. Every 
once in a while some Japanese guys pop on-and-off here, and some of them 
don't even speak English, so they use a machine translator(!) to talk 
with us. Just guess if they use ASCII in their programs. And you know 
what, most of these guys even use their own characters for variable 
names in D!

And not one of them has complained about "disappointing results".

---

That's why I continued with: keep your eyes shut and keep on coding.



More information about the Digitalmars-d mailing list