From c53ddcdee17e689e86d77cbfff01725aea4ea71a Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 16 Jan 2012 14:20:51 -0500 Subject: [PATCH] Fixed crash under Cocoa when dupeGuru was launched from a path containing non-ascii characters. --- cocoa/base/main.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cocoa/base/main.m b/cocoa/base/main.m index 163a7b58..9839b794 100644 --- a/cocoa/base/main.m +++ b/cocoa/base/main.m @@ -9,10 +9,13 @@ http://www.hardcoded.net/licenses/bsd_license #import #import #import +#import int main(int argc, char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + /* We have to set the locate to UTF8 for mbstowcs() to correctly convert non-ascii chars in paths */ + setlocale(LC_ALL, "en_US.UTF-8"); NSString *respath = [[NSBundle mainBundle] resourcePath]; NSString *mainpy = [respath stringByAppendingPathComponent:@"dg_cocoa.py"]; wchar_t wPythonPath[PATH_MAX+1];