|
Boost : |
Subject: Re: [boost] [General] Always treat std::strings as UTF-8
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2011-01-20 18:46:01
On Thu, 20 Jan 2011 12:52:25 -0800
Mostafa <mostafa_working_away_at_[hidden]> wrote:
>>> Can we stick to std::string conventions as closely as possible? It
>>> makes using whatever new string library that much easier, and
>>> clearer, and maintainable.
>>
>> Is there a conventional way to get the data stored in an
>> std::string? ;-)
>
> On second thought, is there really a need to access the underlying
> data of utf8_t? I argue that having a view of the underlying data via
> iterators accomplishes just as much(*), and is more inline with the
> stl tradition of containers and iterators, not to mention the better
> encapsulation it affords the interface. Do clients really need to
> know, and potentially develop a dependency on, the fact that utf8_t
> (for now?) is really just a wrapper for std::string?
For interaction with functions that require std::string, and presumably
don't care about the encoding, it's convenient. Without it, using the
UTF classes with such a function requires calling the std::string
constructor with the element iterators. That's going to be a major need
for the foreseeable future.
-- Chad Nelson Oak Circle Software, Inc. * * *
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk