Boost logo

Boost :

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

Artyom Beilis
CppCMS - C++ Web Framework:
CppDB - C++ SQL Connectivity:

On Fri, 12/20/13, Alexander Lamaison <awl03_at_[hidden]> wrote:

 Subject: [boost] [Locale] translate() couples key and output character widths
 To: boost_at_[hidden]
 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);
 translation key"));
 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
 means changing
 `translate("blah")` to `translate(L"blah")` throughout.
 The change itself is no big deal, but the problem is that it
 feels like
 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
 separate concepts
 and should be allowed to vary independently.  The old
 class `message`
 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
 width string.
 My question, I suppose, is why was this change made? 
 What makes the new
 API better?
 Swish - Easy SFTP for Windows Explorer (
 Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at