Merge pull request #7381 from sum2012/cw-cheat

Create as UTF-8 format of new cwcheat file
This commit is contained in:
Henrik Rydgård 2015-01-31 16:55:24 +01:00
commit deb2f838d0

View file

@ -1,3 +1,5 @@
#include "i18n/i18n.h"
#include "UI/OnScreenDisplay.h"
#include "Common/StringUtils.h"
#include "Common/ChunkFile.h"
#include "Common/FileUtil.h"
@ -39,7 +41,16 @@ static void __CheatStart() {
File::CreateFullPath(GetSysDirectory(DIRECTORY_CHEATS));
if (!File::Exists(activeCheatFile)) {
File::CreateEmptyFile(activeCheatFile);
FILE *f = File::OpenCFile(activeCheatFile, "wb");
if (f) {
fwrite("\xEF\xBB\xBF", 1, 3, f);
fclose(f);
}
if (!File::Exists(activeCheatFile)) {
I18NCategory *err = GetI18NCategory("Error");
osm.Show(err->T("Unable to create cheat file, disk may be full"));
}
}
cheatEngine = new CWCheatEngine();