Boost logo

Boost Users :

Subject: [Boost-users] [Locale] as::ftime formatting
From: Szymon Gatner (szymon.gatner_at_[hidden])
Date: 2013-01-09 08:29:30


Hey,

docs say: "There is a list of supported strftime flags by ICU
backend:". I didn't build my boost/locale with ICU but still tried
what happens when I try as::ftime("%A") an to my surprise I got
correctly localized day of the week.

My questions are: is it correct that it works without ICU? will it
work on other machines (Win 32 bit)? What is the encoding of output
string? I am seeing it correctly displayed as utf-8 but would like to
know what is happening. Can I ensure utf-8 output?

My test code:

using namespace boost::locale;

generator gen;
locale loc=gen("");

std::ostringstream ostr;
ostr.imbue(loc);
ostr << as::datetime << as::ftime("%A") << info.time;
std::String timeStr = ostr.str();

Cheers,
Simon

-- 
Szymon Gatner
The Lordz Games Studio
www.thelordzgamesstudio.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net