(svn r3966) -Fix: [OSX and some linux] [ 1157244 ] Can't save game if name contains german umlauts

now it saves correctly, but the load window still display some chars wrong (fix by ln-)
This commit is contained in:
bjarni
2006-03-18 15:55:24 +00:00
parent a137268f13
commit 5affa77822
4 changed files with 79 additions and 5 deletions

View File

@@ -12,6 +12,12 @@
#include "screenshot.h"
#include "variables.h"
#ifdef UNIX
extern const char *convert_to_fs_charset(const char *filename);
#else
#define convert_to_fs_charset(str) (str)
#endif // UNIX
char _screenshot_format_name[8];
uint _num_screenshot_formats;
uint _cur_screenshot_format;
@@ -73,7 +79,7 @@ static bool MakeBmpImage(const char *name, ScreenshotCallback *callb, void *user
if (pixelformat != 8)
return false;
f = fopen(name, "wb");
f = fopen(convert_to_fs_charset(name), "wb");
if (f == NULL) return false;
// each scanline must be aligned on a 32bit boundary
@@ -177,7 +183,7 @@ static bool MakePNGImage(const char *name, ScreenshotCallback *callb, void *user
if (pixelformat != 8)
return false;
f = fopen(name, "wb");
f = fopen(convert_to_fs_charset(name), "wb");
if (f == NULL) return false;
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, (char *)name, png_my_error, png_my_warning);
@@ -288,7 +294,7 @@ static bool MakePCXImage(const char *name, ScreenshotCallback *callb, void *user
if (pixelformat != 8 || w == 0)
return false;
f = fopen(name, "wb");
f = fopen(convert_to_fs_charset(name), "wb");
if (f == NULL) return false;
memset(&pcx, 0, sizeof(pcx));