Boost logo

Boost :

Subject: Re: [boost] [Locale] translate() couples key and output character widths
From: Alexander Lamaison (awl03_at_[hidden])
Date: 2013-12-20 06:42:02


Artyom Beilis <artyomtnk_at_[hidden]> writes:

> 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.
>
> See: http://thread.gmane.org/gmane.comp.lib.boost.devel/218543
>
> Also you can search boost lists the locale review comments...

I remember the discussion and I understand why `message` was templated to
allow wchar_t keys. But what I don't understand is why the templated
`basic_message` lost one of its coersion (conversion) methods in the
process?

In other words, why these don't work:

std::wstring(boost::locale::basic_message<char>("blah"));
std::string(boost::locale::basic_message<wchar_t>(L"wideblah"));

Alex

--
Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk