@@ -18,21 +18,18 @@ #include #include #include -#ifdef HAVE_LANGINFO_H -# include -#endif #include #include #import "OFApplication.h" #import "OFString.h" #import "OFArray.h" #import "OFDictionary.h" -#import "OFSystemInfo.h" +#import "OFLocalization.h" #import "OFRunLoop.h" #import "OFRunLoop+Private.h" #import "OFThread.h" #import "OFThread+Private.h" @@ -70,11 +67,10 @@ #endif - (void)OF_run; @end static OFApplication *app = nil; -extern void of_system_info_parse_locale(char*); static void atexitHandler(void) { id delegate = [app delegate]; @@ -107,11 +103,11 @@ #ifdef OF_WINDOWS wchar_t **wargv, **wenvp; int wargc, si = 0; #endif - of_system_info_parse_locale(setlocale(LC_ALL, "")); + [[OFLocalization alloc] initWithLocale: setlocale(LC_ALL, "")]; if ([cls isSubclassOfClass: [OFApplication class]]) { fprintf(stderr, "FATAL ERROR:\n Class %s is a subclass of " "class OFApplication, but class\n %s was specified as " "application delegate!\n Most likely, you wanted to " @@ -246,15 +242,16 @@ } FreeEnvironmentStringsW(env0); #elif !defined(OF_IOS) if (env != NULL) { + const of_string_encoding_t encoding = + [OFLocalization encoding]; + for (; *env != NULL; env++) { OFString *key, *value; char *sep; - const of_string_encoding_t encoding = - [OFSystemInfo native8BitEncoding]; pool = objc_autoreleasePoolPush(); if ((sep = strchr(*env, '=')) == NULL) { fprintf(stderr, "Warning: Invalid " @@ -351,11 +348,11 @@ of_string_encoding_t encoding; _argc = argc; _argv = argv; - encoding = [OFSystemInfo native8BitEncoding]; + encoding = [OFLocalization encoding]; # ifndef OF_NINTENDO_DS if (*argc > 0) { # else if (__system_argv->argvMagic == ARGV_MAGIC &&