diff --git a/Source/Additions/GSXML.m b/Source/Additions/GSXML.m index 9fe69ea8f..be749ab60 100644 --- a/Source/Additions/GSXML.m +++ b/Source/Additions/GSXML.m @@ -2576,7 +2576,20 @@ loadEntityFunction(const unsigned char *url, const unsigned char *eid, if ([file length] > 0) { - ret = xmlNewInputFromFile(ctx, [file fileSystemRepresentation]); + const char *path; + +#if defined(__MINGW32__) + /* + * The xmlNewInputFromFile() function requires an eight bit string + * but on a modern windows filesystem the file name could be unicode + * which can't be represented as a cString ... and may cause an + * exception ... nothing we can do about it really. + */ + path = [file cString]; +#else + path = [file fileSystemRepresentation]; +#endif + ret = xmlNewInputFromFile(ctx, path); } else { diff --git a/Source/NSProcessInfo.m b/Source/NSProcessInfo.m index 544e6c393..6a9dcc136 100644 --- a/Source/NSProcessInfo.m +++ b/Source/NSProcessInfo.m @@ -1108,7 +1108,11 @@ static BOOL debugTemporarilyDisabled = NO; extern int _NSLogDescriptor; int desc; +#if defined(__MINGW32__) + desc = _wopen([path fileSystemRepresentation], O_RDWR|O_CREAT|O_APPEND, 0644); +#else desc = open([path fileSystemRepresentation], O_RDWR|O_CREAT|O_APPEND, 0644); +#endif if (desc >= 0) { if (_NSLogDescriptor >= 0 && _NSLogDescriptor != 2)