@@ -279,12 +279,12 @@ WIN32_FIND_DATA fd; pool = [[OFAutoreleasePool alloc] init]; path = [path stringByAppendingString: @"\\*"]; - if ((handle = FindFirstFile([path cString], &fd)) == - INVALID_HANDLE_VALUE) + if ((handle = FindFirstFile([path cStringWithEncoding: + OF_STRING_ENCODING_NATIVE], &fd)) == INVALID_HANDLE_VALUE) @throw [OFOpenFileFailedException exceptionWithClass: self path: path mode: @"r"]; @try { @@ -295,11 +295,13 @@ if (!strcmp(fd.cFileName, ".") || !strcmp(fd.cFileName, "..")) continue; - file = [OFString stringWithCString: fd.cFileName]; + file = [OFString + stringWithCString: fd.cFileName + encoding: OF_STRING_ENCODING_NATIVE]; [files addObject: file]; [pool2 releaseObjects]; } while (FindNextFile(handle, &fd)); @@ -333,11 +335,12 @@ @throw [OFChangeFileModeFailedException exceptionWithClass: self path: path mode: mode]; # else - DWORD attributes = GetFileAttributes([path cString]); + DWORD attributes = GetFileAttributes( + [path cStringWithEncoding: OF_STRING_ENCODING_NATIVE]); if (attributes == INVALID_FILE_ATTRIBUTES) @throw [OFChangeFileModeFailedException exceptionWithClass: self path: path @@ -346,11 +349,12 @@ if ((mode / 100) & 2) attributes &= ~FILE_ATTRIBUTE_READONLY; else attributes |= FILE_ATTRIBUTE_READONLY; - if (!SetFileAttributes([path cString], attributes)) + if (!SetFileAttributes([path cStringWithEncoding: + OF_STRING_ENCODING_NATIVE], attributes)) @throw [OFChangeFileModeFailedException exceptionWithClass: self path: path mode: mode]; # endif @@ -472,10 +476,12 @@ if (fstat(sourceFile->fileDescriptor, &s) == 0) fchmod(destinationFile->fileDescriptor, s.st_mode); } +#else + (void)override; #endif } @finally { [sourceFile close]; [destinationFile close]; free(buffer);