Boost logo

Boost :

Subject: Re: [boost] [string] proposal
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2011-01-27 09:05:02


Dean Michael Berris wrote:
> On Thu, Jan 27, 2011 at 5:32 PM, Matus Chochlik
> <chochlik_at_[hidden]> wrote:
> > On Thu, Jan 27, 2011 at 4:49 AM, Dean Michael Berris
> > <mikhailberis_at_[hidden]> wrote:
>
> >> I don't think I was questioning why UTF-8 specifically. I was
> >> questioning why there had to be a "default is UTF-8" when
> >> really it's just a sequence of bytes whether UTF-8, MPEG,
> >> Base64, MIME, etc.
> >
> > Last time I checked, JPEG, MPEG, Base64, ASN1, etc., etc., were not
> > *text* encodings. And I believe that handling text is what the whole
> > discussion is ultimately about.
>
> But why do you need to separate text encoding from encoding in
> general?

Names are important. I think this discussion would make more progress if Dean's "string" were given another name, like "bytes," and his "view" were named "string" or perhaps "string_view."

> You have a sequence of bytes (in a string).

That would be a sequence of bytes in a bytes<char>, say.

> You want to interpret that sequence of bytes in a given
> encoding (with a view).

You'd interpret the bytes<char> with a string<utf_8>, say.

> > Again, where you see a string primarily as a class for handling
> > raw data, that can be interpreted in hundreds of different ways
> > I see primarily string as a class for encoding human readable text.
>
> So what's the difference between a string for encoding human readable
> text and a string that handles raw data?

There is no difference, but because "string" connotes "human readable text" to most, using a different name for the raw storage class will dissociate that connotation from the raw storage.

HTH,

_____
Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP http://www.sig.com

IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk