سلام.همه چیز درسته و local توی کد شما مشخص نشده.
const std::locale utf8_locale = std::locale(std::locale(), new std::codecvt_utf8<wchar_t>());
const std::string file_name ;
wofstream stream(file_name);
stream.imbue(utf8_locale);
std::wstring my_str;
stream << my_str << endl;
stream.close();