The following sample code, compiled with -lboost_locale generates a bad cast exception as well as memory leak . It is the same code in the boost documentation itself. Any he