Boost logo

Boost :

Subject: Re: [boost] Boost.Locale (was Re: [SQL-Connectivity] Is Boost interested in CppDB?)
From: Stewart, Robert (Robert.Stewart_at_[hidden])
Date: 2010-12-15 07:59:40

Mathias Gaunard wrote:
> On 15/12/2010 00:28, Joel de Guzman wrote:
> > On 12/15/2010 7:13 AM, Mathias Gaunard wrote:
> >> On 14/12/2010 22:05, Edward Diener wrote:
> >>> On 12/14/2010 2:27 PM, Mathias Gaunard wrote:
> >>>> On 14/12/2010 16:08, Eric Niebler wrote:
> >>>>> On 12/14/2010 9:53 AM, Dean Michael Berris wrote:
> >>>>>> +1 -- if there was a library that did easy conversion from
> >>>>>> std::wstring (usually the default in Windows now) to
> >>>>>> proper UTF-8 encoded std::string in Boost that would be
> >>>>>> *awesome*. I can totally use that library in cpp-netlib too.
> >>>>>
> >>>>> Please, no. std::string is not an appropriate holder for a UTF-8
> >>>>> string. It encourages random-access mutation of any byte in a
> >>>>> UTF-8 sequence, pretty much guaranteeing data corruption.
> >>>>
> >>>> It is, however, an appropriate holder for the *data* of
> >>>> a UTF-8 string.
> <snip stuff that seems irrelevant to the message>
> > UTF-8 is variable length encoded (so is UTF-16). basic_string
> > and string are unsuitable for any variable length encoded data,
> > as Eric pointed out.
> What I said is that basic_string<char> is perfectly suitable as a
> container to store UTF-8 data; it is not, however, very suitable
> to do text processing with (albeit UTF-8 has sufficiently nice
> properties to make it more or less passable).
> Raw data is different from an abstraction meant to represent text.

I disagree. vector<char> would be a suitable storage container for the raw data. basic_string<char> implies string semantics.

Rob Stewart robert.stewart_at_[hidden]
Software Engineer, Core Software using std::disclaimer;
Susquehanna International Group, LLP

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, gregod at, cpdaniel at, john at