Note: This unconditionally assumes wchar_t support. May need revision if some platforms prove problematic.