mirror of
https://github.com/nzbget/nzbget.git
synced 2026-05-19 10:34:28 -04:00
#136: Unicode-Windows-API for file operations
- internally all paths are handled in UTF8; - all paths are stored in config-file in UTF8; - when calling file access Windows API functions the paths are converted to wide-chars and Unicode-API is used; - extra long paths are prefixed with “\\?\” (extended path format).
This commit is contained in:
@@ -478,14 +478,7 @@ bool Scanner::AddFileToQueue(const char* filename, const char* nzbName, const ch
|
||||
if (nzbName && strlen(nzbName) > 0)
|
||||
{
|
||||
nzbInfo->SetName(NULL);
|
||||
#ifdef WIN32
|
||||
char* ansiFilename = strdup(nzbName);
|
||||
WebUtil::Utf8ToAnsi(ansiFilename, strlen(ansiFilename) + 1);
|
||||
nzbInfo->SetFilename(ansiFilename);
|
||||
free(ansiFilename);
|
||||
#else
|
||||
nzbInfo->SetFilename(nzbName);
|
||||
#endif
|
||||
nzbInfo->BuildDestDirName();
|
||||
}
|
||||
|
||||
@@ -583,10 +576,6 @@ Scanner::EAddStatus Scanner::AddExternalFile(const char* nzbName, const char* ca
|
||||
BString<1024> validNzbName = FileSystem::BaseFileName(nzbName);
|
||||
FileSystem::MakeValidFilename(validNzbName, '_', false);
|
||||
|
||||
#ifdef WIN32
|
||||
WebUtil::Utf8ToAnsi(validNzbName, validNzbName.Capacity());
|
||||
#endif
|
||||
|
||||
const char* extension = strrchr(nzbName, '.');
|
||||
if (nzb && (!extension || strcasecmp(extension, ".nzb")))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user