Subject: Re: [boost] [Locale] translate() couples key and output character widths
From: Artyom Beilis (artyomtnk_at_[hidden])
Date: 2013-12-20 06:34:04
That was a loooooong and painful discussion during the boost.locale review.
Such a change was asked by the reviewers that wanted to be able to use
wide strings as keys. For example
translate(L"© All Rights Are Reserved")
Where "©" is non-ASCII character.
This change was mostly required to support non-ascii characters in keys.
To be honest I was strongly against the change but finally had to accept it.
Also you can search boost lists the locale review comments...
CppCMS - C++ Web Framework: http://cppcms.com/
CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
On Fri, 12/20/13, Alexander Lamaison <awl03_at_[hidden]> wrote:
Subject: [boost] [Locale] translate() couples key and output character widths
Date: Friday, December 20, 2013, 1:01 PM
I've finally gotten round to changing
from the pre-release version of
Boost.Locale (v2.92) to the version now in Boost, and I was
surprised by one change. Previously, I could do the
void function_takes_wide_string(std::wstring message);
However, with the new version, the key must be passed in as
a wide string
if I am to be able to get a wide string out. This
`translate("blah")` to `translate(L"blah")` throughout.
The change itself is no big deal, but the problem is that it
a change for the worse. The character width of the key
is now coupled
to the character width of the output, when the two are
and should be allowed to vary independently. The old
coeerced the string to whichever width was required.
The new class
`basic_message<T>` coerces only to
`basic_string<T>` and, worse than
that, doesn't provide a method to explicitly convert to a
My question, I suppose, is why was this change made?
What makes the new
Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk