ietf
[Top] [All Lists]

Re: Troubles with UTF-8

2006-01-03 06:48:49
Tim Bray wrote:
On Dec 28, 2005, at 12:46 PM, Randy Presuhn wrote:

Reserving NUL as a special terminator is a C library-ism.  I think  that
history has shown that the use of this kind of mechanism, rather than
explicitly tracking the string's length, was a mistake.


I guess variably lenght V-records of type

string {int type,
        int length,
        int data[] );

would be horror. That will lose you 4 bytes per word and 2 bytes for
every printable sign.

C-ASCII "Randy Presuhn" = 14 char + '\0'.

Compare it to

     99999, " R"," a"," n"," d"," y",
     99999, " P"," r"," e"," s"," h"," u"," n"

That is 28 characters now. No alternative.



I used to think so too, but I don't any more; twenty years of doing text processing has convinced me that C's null-terminated strings simply cannot be improved on in a low-level programming language. For more on the subject see http://www.tbray.org/ongoing/When/200x/ 2003/04/13/Strings -Tim


_______________________________________________
Ietf mailing list
Ietf(_at_)ietf(_dot_)org
https://www1.ietf.org/mailman/listinfo/ietf




--
Peter and Karin Dambier
The Public-Root Consortium
Graeffstrasse 14
D-64646 Heppenheim
+49(6252)671-788 (Telekom)
+49(179)108-3978 (O2 Genion)
+49(6252)750-308 (VoIP: sipgate.de)
mail: peter(_at_)echnaton(_dot_)serveftp(_dot_)com
mail: peter(_at_)peter-dambier(_dot_)de
http://iason.site.voila.fr/
https://sourceforge.net/projects/iason/


_______________________________________________
Ietf mailing list
Ietf(_at_)ietf(_dot_)org
https://www1.ietf.org/mailman/listinfo/ietf

<Prev in Thread] Current Thread [Next in Thread>