There really doesn't seem to be a good reason to `#ifdef` here. Use something like std::codecvt to do the conversion if necessary. I mean the above call to `wstr.c_str()` is wrong anyway. Please use `wstr.wx_str()` and check if sizeof(wxStringCharType) is 1,2 or 4 to see which conversion is necessary and if one is necessary at all