Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boost.format and wide characters

Is there a way to get boost.format to use and return wide (Unicode) character strings?

I'd like to be able to do things like:

wcout << boost::format(L"...") % ...

and

wstring s = boost::str(boost::format(L"...") % ...)

Is this possible?

like image 846
Ferruccio Avatar asked Dec 17 '08 19:12

Ferruccio


1 Answers

format_fwd.hpp contains this typedef:

typedef basic_format<wchar_t >  wformat;

I think this will get you started. This works here:

std::wcout << boost::wformat(L"...") % ...

Also the boost::str works using wformat.

like image 98
Johannes Schaub - litb Avatar answered Nov 16 '22 03:11

Johannes Schaub - litb