I'm trying to use my own codecvt
with standard iostreams. I'm using this line:
std::cout.imbue(std::locale(std::locale("C"), new rot13codecvt()));
rot13codecvt
is just an example, shamelessly lifted verbatim from the interwebs. A full runnable example is here. My real codecvt does something different.
As you can see in the linked live example, this doesn't quite work in g++. The output is not rot13d. No function from the custom codecvt class is ever called. But it works well in VS2012.
I have tried other locales beside "C" and none are working. Also tried an example here, same result.
What am I doing wrong?