Skip to content

Commit 9e7b20d

Browse files
committed
utils: Use u8path to fix possible string conversion crashes on Windows
All other path operations in the code base already use u8path to ensure that the strings provided by libobs (which will either be ASCII or UTF-8 byte sequences) are correctly converted into UTF-16 strings.
1 parent eed8a49 commit 9e7b20d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/Json.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ bool Utils::Json::SetJsonFileContent(std::string fileName, const json &content,
197197
{
198198
if (makeDirs) {
199199
std::error_code ec;
200-
auto p = std::filesystem::path(fileName).parent_path();
200+
auto p = std::filesystem::u8path(fileName).parent_path();
201201
if (!ec && !std::filesystem::exists(p, ec))
202202
std::filesystem::create_directories(p, ec);
203203
if (ec) {

0 commit comments

Comments
 (0)