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.
This commit is contained in:
PatTheMav 2025-05-03 12:30:54 +02:00 • committed by Ryan Foster
commit 16216b2e30

View file

@ -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"),