Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: Fat String ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 20 of 21 Topic 9772 of 9943
Post > Topic >>

Re: Fat String Class

by Alberto Ganesh Barbati <AlbertoBarbati@[EMAIL PROTECTED] > Jul 23, 2008 at 07:40 PM

Le Chaud Lapin ha scritto:
> 
> Second, the example I used comparing French "exasperation" to English
> "exasperation" was poor. I was probably  tired.  I am again tired, so
> no good examples come to mind right now, but my gut feeling is that
> the class should have at least what I have been calling "locale", even

I guess "language" is a more appropriate term than locale here, unless
with "locale" you mean other kind of contextual metadata, which is bound
to be more complex.

> though that might not be the correct term. All of you have warned
> against putting intelligence in the string class. I wonder if this bit
> of extra information would count as too much intelligence.  While I
> have not read enough about Unicode to know the path I will follow, I
> will probably include this bit of information anyway. 

> <snip>

> String<> s1 = "mein"; // German for English "mine"
> String<> s2 = "mein"; // English stolen from Chinese for type of
> noodle.

Ok, so... what about this:

   "Let's eat spaghetti, a bratwurst and a crème brûlée"

is this English, Italian, German or French? You can't simply attach
metadata to the *whole* string, you have to consider substrings too. You
have two choices, either you can store metadata in a struct separate
from the textual data, or you store them in the textual data itself by
effectively introducing some form of tagging. XML (with xml:lang) and
Unicode language tags (see 16.9 in
http://www.unicode.org/versions/Unicode5.0.0/ch16.pdf)
follow in the
latter category. Despite the obvious added complexity in parsing and
traversing the string, the tag approach has a lot of advantages.
However, according to Unicode terminology, attached metadata are
responsibility of a "higher level protocol" and so, IMHO, should not be
addressed by the basic container.

Just my opinion,

Ganesh


-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 21 Posts in Topic:
Fat String Class
Le Chaud Lapin <jaibud  2008-07-07 17:45:21 
Re: Fat String Class
Alberto Ganesh Barbati &l  2008-07-08 05:29:37 
Re: Fat String Class
=?UTF-8?B?RXJpayBXaWtzdHL  2008-07-08 05:31:14 
Re: Fat String Class
Oncaphillis <oncaphill  2008-07-08 15:28:05 
Re: Fat String Class
Oncaphillis <oncaphill  2008-07-08 15:22:15 
Re: Fat String Class
Harald Luessen <harald  2008-07-08 15:31:50 
Re: Fat String Class
Alberto Ganesh Barbati &l  2008-07-08 20:27:32 
Re: Fat String Class
Mathias Gaunard <loufo  2008-07-09 13:28:05 
Re: Fat String Class
Oncaphillis <oncaphill  2008-07-09 13:32:50 
Re: Fat String Class
Pavel Minaev <int19h@[  2008-07-09 14:58:18 
Re: Fat String Class
Bart van Ingen Schenau &l  2008-07-09 14:58:09 
Re: Fat String Class
Harald Luessen <harald  2008-07-10 20:28:09 
Re: Fat String Class
Nominal Pro <majorscio  2008-07-11 14:12:09 
Re: Fat String Class
Francis Glassborow <fr  2008-07-11 14:14:29 
Re: Fat String Class
Mathias Gaunard <loufo  2008-07-12 10:39:38 
Re: Fat String Class
Eugene Gershnik <gersh  2008-07-14 09:18:48 
Re: Fat String Class
ManicQin <ManicQin@[EM  2008-07-15 10:28:09 
Re: Fat String Class
Le Chaud Lapin <jaibud  2008-07-23 03:58:15 
Re: Fat String Class
"Bo Persson" &l  2008-07-23 19:40:22 
Re: Fat String Class
Alberto Ganesh Barbati &l  2008-07-23 19:40:24 
Re: Fat String Class
Le Chaud Lapin <jaibud  2008-07-23 23:48:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Aug 29 9:22:04 CDT 2008.