- attempt to get non ascii file paths working in megaglest (Japanese etc...)

This commit is contained in:
Mark Vejvoda
2011-05-18 21:49:11 +00:00
parent 727c7b33d9
commit 60b8093f5b
34 changed files with 519 additions and 110 deletions

View File

@@ -15,6 +15,7 @@
#include "math_wrapper.h"
#include <cstdlib>
#include <stdexcept>
#include "platform_util.h"
using namespace Shared::Util;
using namespace std;
@@ -682,7 +683,11 @@ void MapPreview::switchSurfaces(MapSurfaceType surf1, MapSurfaceType surf2) {
void MapPreview::loadFromFile(const string &path) {
#ifdef WIN32
FILE* f1= _wfopen(utf8_decode(path).c_str(), L"rb");
#else
FILE *f1 = fopen(path.c_str(), "rb");
#endif
if (f1 != NULL) {
//read header
@@ -751,8 +756,11 @@ void MapPreview::loadFromFile(const string &path) {
void MapPreview::saveToFile(const string &path) {
#ifdef WIN32
FILE* f1= _wfopen(utf8_decode(path).c_str(), L"wb");
#else
FILE *f1 = fopen(path.c_str(), "wb");
#endif
if (f1 != NULL) {
//write header