Przeglądaj źródła

frontend: Fix character encoding issue during profile import

The directory name string passed into libobs functions needs to be
converted into a 8-bit-based encoding (e.g., UTF-8) to avoid mangling
of characters and encoding issues particularly on Windows systems which
use UTF-16 for file names.
PatTheMav 5 miesięcy temu
rodzic
commit
16216b2e30
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      frontend/widgets/OBSBasic_Profiles.cpp

+ 1 - 1
frontend/widgets/OBSBasic_Profiles.cpp

@@ -554,7 +554,7 @@ void OBSBasic::on_actionImportProfile_triggered()
 
 	if (!sourceDirectory.isEmpty() && !sourceDirectory.isNull()) {
 		const std::filesystem::path sourcePath = std::filesystem::u8path(sourceDirectory.toStdString());
-		const std::string directoryName = sourcePath.filename().string();
+		const std::string directoryName = sourcePath.filename().u8string();
 
 		if (auto profile = GetProfileByDirectoryName(directoryName)) {
 			OBSMessageBox::warning(this, QTStr("Basic.MainMenu.Profile.Import"),