Boost logo

Boost :

Subject: Re: [boost] [General] Always treat std::strings as UTF-8
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2011-01-17 18:47:04


On Mon, 17 Jan 2011 23:14:48 +0000
Alexander Lamaison <awl03_at_[hidden]> wrote:

> On Mon, 17 Jan 2011 10:09:13 -0800 (PST), Artyom wrote:
>
>> [...] Invening "special unicode strings or storage" does not improve
>> anybody's understanding of Unicode neither improve its handing.
>
> I don't understand how it could possibly not help. If I see an api
> function call_me(std::string arg) I know next to nothing about what
> it's expecting from the string (except that by convention it tends to
> mean 'string in OS-default encoding'). If I see call_me(boost::utf8_t
> arg), I know *exactly* what it's after. Further, assuming I know what
> format my own strings are in, I know how to provide it with what it
> expects.

+1. +100. :-) That's exactly what I was aiming for. And as an added
bonus, if you've got a string type that can translate itself to
utf32_t, then it doesn't matter what kind of string the function wants
because the classes can handle the conversions themselves.

However, after looking into the matter further for this discussion, I
see that he does have a valid point about locales and various encodings.
My classes definitely don't handle those well enough yet, and the
program we're currently developing (which I'm not at liberty to discuss
until it's released) will almost certainly need that.

I really wanted to avoid a dependency on the ICU library or anything
similar if at all possible, but it looks like it might be
inevitable. :-(

-- 
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