Skip to content

Commit 34b45ab

Browse files
committed
AviSynth: Добавлена поддержка скриптов с различными символами в имени файла (а не только текущей кодировки и ANSI).
1 parent eef75ad commit 34b45ab

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Source/AviSynthStream.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,14 @@ CAviSynthStream::CAviSynthStream(const WCHAR* name, CSource* pParent, HRESULT* p
5858

5959
AVS_linkage = m_Linkage = m_ScriptEnvironment->GetAVSLinkage();
6060

61-
std::string ansiFile = ConvertWideToANSI(name);
62-
AVSValue arg(ansiFile.c_str());
61+
std::string utf8file = ConvertWideToUtf8(name);
62+
AVSValue args[2] = { utf8file.c_str(), true };
63+
const char* const arg_names[2] = { 0, "utf8" };
6364
try {
64-
m_AVSValue = m_ScriptEnvironment->Invoke("Import", AVSValue(&arg, 1));
65+
m_AVSValue = m_ScriptEnvironment->Invoke("Import", AVSValue(args, 2), arg_names);
6566
}
6667
catch (const AvisynthError& e) {
67-
error = ConvertAnsiToWide(e.msg);
68+
error = ConvertUtf8ToWide(e.msg);
6869
throw std::exception("Failure to open Avisynth script file.");
6970
}
7071

0 commit comments

Comments
 (0)