Fix the replay menu for people with non-latin characters in their username.

Use OsPath instead of CStr and CStrW where possible,
wstring_from_utf8(OsPath.string8()) to pass printable strings to the
JSAPI,
OsString when opening a filestream and
off_t instead of int for filesizes.

Fixes #4320
Differential Revision: https://code.wildfiregames.com/D518
Reviewed By: Imarok
Tested By: Imarok on Windows, wraitii on OSX
Special thanks to Philip for advice and the lib/path.h fix in
47cc447322.

This was SVN commit r19824.
This commit is contained in:
elexis
2017-06-25 14:54:00 +00:00
parent 47cc447322
commit e7ab22286e
11 changed files with 59 additions and 60 deletions
@@ -60,7 +60,7 @@ void JSI_VisualReplay::AddReplayToCache(ScriptInterface::CxPrivate* pCxPrivate,
CStrW JSI_VisualReplay::GetReplayDirectoryName(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const CStrW& directoryName)
{
return OsPath(VisualReplay::GetDirectoryName() / directoryName).string();
return wstring_from_utf8(OsPath(VisualReplay::GetDirectoryName() / directoryName).string8());
}
void JSI_VisualReplay::RegisterScriptFunctions(ScriptInterface& scriptInterface)