(svn r3972) changed r3966 to only affect OSX. Too bad linuxes with utf-8 filesystems now got the saving problem again, but now we can compile on all platforms again
authorbjarni
Sat, 18 Mar 2006 16:37:25 +0000
changeset 3262 ac6619206ebe
parent 3261 618bb5210e94
child 3263 5bfa90662e54
(svn r3972) changed r3966 to only affect OSX. Too bad linuxes with utf-8 filesystems now got the saving problem again, but now we can compile on all platforms again
saveload.c
screenshot.c
unix.c
--- a/saveload.c	Sat Mar 18 16:11:29 2006 +0000
+++ b/saveload.c	Sat Mar 18 16:37:25 2006 +0000
@@ -1314,11 +1314,11 @@
 extern void BeforeSaveGame(void);
 extern bool LoadOldSaveGame(const char *file);
 
-#ifdef UNIX
+#ifdef __APPLE__
 extern const char *convert_to_fs_charset(const char *filename);
 #else
 #define convert_to_fs_charset(str) (str)
-#endif // UNIX
+#endif
 
 /** Small helper function to close the to be loaded savegame an signal error */
 static inline SaveOrLoadResult AbortSaveLoad(void)
--- a/screenshot.c	Sat Mar 18 16:11:29 2006 +0000
+++ b/screenshot.c	Sat Mar 18 16:37:25 2006 +0000
@@ -12,11 +12,11 @@
 #include "screenshot.h"
 #include "variables.h"
 
-#ifdef UNIX
+#ifdef __APPLE__
 extern const char *convert_to_fs_charset(const char *filename);
 #else
 #define convert_to_fs_charset(str) (str)
-#endif // UNIX
+#endif
 
 char _screenshot_format_name[8];
 uint _num_screenshot_formats;
--- a/unix.c	Sat Mar 18 16:11:29 2006 +0000
+++ b/unix.c	Sat Mar 18 16:37:25 2006 +0000
@@ -43,14 +43,13 @@
 #endif
 
 #if defined(__APPLE__)
+	#include <iconv.h>
+	#include <locale.h>
 	#if defined(WITH_SDL)
 		//the mac implementation needs this file included in the same file as main()
 		#include <SDL.h>
 	#endif
 #endif
-
-#include <iconv.h>
-#include <locale.h>
 static char *_fios_path;
 static char *_fios_save_path;
 static char *_fios_scn_path;
@@ -607,22 +606,7 @@
 	#endif // __AMIGA__
 }
 
-bool guessUTF8(void)
-{
-#if defined(__linux__)
-	const char *lang = getenv("LANG");
-	if(lang != NULL && strstr(lang, "UTF-8") != NULL)
-		return true;
-	else
-		return false;
-#elif defined(__APPLE__)
-	return true;
-#else
-	return false;
-#endif
-
-}
-
+#ifdef __APPLE__
 /* FYI: This is not thread-safe.
 Assumptions:
 	- the 'from' charset is ISO-8859-15
@@ -640,8 +624,6 @@
 	if(inbuf == NULL)
 		inbuf = statin;
 
-	if(guessUTF8() == false)
-		return filename;
 	setlocale(LC_ALL, "C-UTF-8");
 	strcpy(statout, filename);
 	strcpy(statin, filename);
@@ -659,3 +641,4 @@
 	// FIX: invalid characters will abort conversion, but they shouldn't occur?
 	return statout;
 }
+#endif