mirror of
https://github.com/glest/glest-source.git
synced 2025-09-25 15:09:03 +02:00
- attempt to get non ascii file paths working in megaglest (Japanese etc...)
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user