The following code does not work with Borland C++ 5.82:
1 2 3 4 5 6 7 8 9 10 11 12 13
...
#include "utf8_locale.hpp"
const std::locale utf8_locale( // A global object
std::locale::classic(),
new duthomhas::unicode::utf8_facet
);
int main()
{
wofstream outf;
outf.imbue( utf8_locale );
...
But the following does:
1 2 3 4 5 6 7 8 9 10 11 12 13
...
#include "utf8_locale.hpp"
int main()
{
const std::locale utf8_locale( // A local object
std::locale::classic(),
new duthomhas::unicode::utf8_facet
);
wofstream outf;
outf.imbue( utf8_locale );
...
Is there some sort of magic trick to locales that I am missing? Why won't it work for a global locale but only a local locale?
(It worked perfectly both ways using the MinGW GCC.) It also took me forever to figure out that this was what I had done differently from the (very simple) example I was working off of.