diff --git a/base/applications/rapps/cabinet.cpp b/base/applications/rapps/cabinet.cpp index 46b9484f161..3163f6bc4c0 100644 --- a/base/applications/rapps/cabinet.cpp +++ b/base/applications/rapps/cabinet.cpp @@ -47,7 +47,7 @@ MultiByteToWide(const CStringA &szSource, CStringW &szDest, UINT Codepage) return FALSE; // do the actual conversion - sz = MultiByteToWideChar(CP_UTF8, 0, szSource, -1, szDest.GetBuffer(sz), sz); + sz = MultiByteToWideChar(Codepage, 0, szSource, -1, szDest.GetBuffer(sz), sz); szDest.ReleaseBuffer(); return sz != 0; @@ -160,7 +160,8 @@ FNFDINOTIFY(fnNotify) // Append the destination directory to the file name. MultiByteToWide(pND->OutputDir, szExtractDir, CP_UTF8); - MultiByteToWide(pfdin->psz1, szCabFileName, CP_ACP); + UINT codepage = (pfdin->attribs & _A_NAME_IS_UTF) ? CP_UTF8 : CP_ACP; + MultiByteToWide(pfdin->psz1, szCabFileName, codepage); if (!NotifyFileExtractCallback(szCabFileName, pfdin->cb, pfdin->attribs, pND->Callback, pND->CallerCookie))