Boost logo

Boost :

Subject: [boost] Utf8_codecvt_facet for UTF-16 (was:[filesystem][cygwin] Standard conformancefor wide characters)
From: Eric MALENFANT (Eric.Malenfant_at_[hidden])
Date: 2009-02-06 10:24:06


frederic.bron wrote:
>
> Thanks for the advice but I have absolutely no idea of how to
> use wide characters. I have never used them. C++ standard
> does not say what can be done with wide characters. For
> example how can I read properly a file written in UTF8?

I wanted to reply:
  std::wifstream f("AFileInUtf8.txt");
  f.imbue(std::locale(std::locale(), new
boost::utf8_codecvt_facet<wchar_t>);

But it seems that the codecvt_facet in
boost/libs/detail/utf8_codecvt_facet.cpp only supports UTF-8<=>UCS-4
conversions.
It thus seems that it can't be used with wchar_t on a platform where
sizeof(wchar_t) != 4, right?

Am I missing something?


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