Win32APIには御存知の通りWideCharToMultiByte関数とMultiByteToWideChar関数があるが、わりと使うのは面倒くさい。 そもそも当たり前だけどstd::basic_string<char_type>使えないし。 というわけでメモ代わりにまとめておく。locale周りはガバのプーさんだけどそこは勘弁して下さい。 結論 これでいいかと。なんとなくshrink_to_fit呼んでるけどこれ必要なのかねぇ #include <string> #include <windows.h> #include <cstring> std::wstring shift_jis_to_utf_16(const std::string& str) { static_assert(sizeof(wchar_t) == 2, "this function is windows on