|
Boost : |
Subject: Re: [boost] [General] Always treat std::strings as UTF-8
From: Dave Abrahams (dave_at_[hidden])
Date: 2011-01-14 10:59:09
At Fri, 14 Jan 2011 17:50:02 +0200,
Peter Dimov wrote:
>
> Dave Abrahams wrote:
> > At Fri, 14 Jan 2011 17:07:20 +0200,
> > Peter Dimov wrote:
> > >
> > > Alexander Lamaison wrote:
> > > > I'm opposed to this strategy simply because it differs from the way
> > > > existing libraries treat narrow strings.
> > >
> > > It differs from them because it's right, and existing libraries are
> > > wrong. Unfortunately, they'll continue being wrong for a long time,
> > > because of this same argument.
> >
> > Does the "right" strategy come with some policies/practices that can
> > allow it to coexist with the existing "wrong" libraries? If so, I'm
> > all +1 on it.
>
> Unfortunately not. A library that requires its input paths to be UTF-8
> always gets bug reports from users who are accustomed to using another
> encoding for their narrow strings. There is plenty of precedent they
> can use to justify their complaint.
I don't see the problem you cited as an answer to my question. Let me
try asking it differently: how do I program in an environment that has
both "right" and "wrong" libraries?
Also, is there any use in trying to get the difference into the type
system, e.g. by using some kind of wrapper over std::string that gives
it a distinct "utf-8" type?
-- Dave Abrahams BoostPro Computing http://www.boostpro.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk