1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2025-03-10 05:34:36 +00:00

Fixed crash under Cocoa when dupeGuru was launched from a path containing non-ascii characters.

This commit is contained in:
Virgil Dupras 2012-01-16 14:20:51 -05:00
parent 9e668b11b8
commit c53ddcdee1

View File

@ -9,10 +9,13 @@ http://www.hardcoded.net/licenses/bsd_license
#import <Cocoa/Cocoa.h>
#import <Python.h>
#import <wchar.h>
#import <locale.h>
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];