# Cannot open a USD stage from a path containing UTF-8 chars

**URL:** <https://forum.aousd.org/t/cannot-open-a-usd-stage-from-a-path-containing-utf-8-chars/2459>\
**Category:** USD\
**Created:** [May 16, 2025, 3:03pm UTC](https://forum.aousd.org/t/cannot-open-a-usd-stage-from-a-path-containing-utf-8-chars/2459 "2025-05-16T15:03:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![glukoz](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@glukoz](https://forum.aousd.org/u/glukoz)\
**Post date:** [May 16, 2025, 3:03pm UTC](https://forum.aousd.org/t/cannot-open-a-usd-stage-from-a-path-containing-utf-8-chars/2459/1 "2025-05-16T15:03:49Z")

</div>

Hi!

I am encountering issues when trying to open a stage from a path containing UTF-8 chars and I am running out of ideas of what the root cause is.

I am on Windows. The code scheme:

```auto
std::wstring Utf8ToWString(const std::string& utf8Str) 
{
	int size_needed = MultiByteToWideChar(CP_UTF8, 0, utf8Str.c_str(), -1, NULL, 0);
	std::wstring wstr(size_needed, 0);
	MultiByteToWideChar(CP_UTF8, 0, utf8Str.c_str(), -1, &wstr[0], size_needed);
	return wstr;
}

void openStage(const std::string& inputScenePath)
{
	if (std::filesystem::exists(Utf8ToWString(inputScenePath)))
	{
		std::cout << "File exists!\n";
	}

	UsdStageRefPtr stage = UsdStage::Open(inputScenePath);

	if (!stage)
	{
		throw std::runtime_error("Failed to open USD file");
	}
}

```

When `inputScenePath` contains ASCII chars only then the code works properly.

As soon as the path contains a non-standard UTF-8 character, its existence is detected properly (the app outputs File Exists) but the Open method returns an error: The system cannot find the file specified.

Any ideas about how to solve it?

---

<div class="post-metadata">

**Author:** ![nvmkuruc](https://avatars.discourse-cdn.com/v4/letter/n/76d3ee/32.png) [@nvmkuruc](https://forum.aousd.org/u/nvmkuruc)\
**Post date:** [May 16, 2025, 3:13pm UTC](https://forum.aousd.org/t/cannot-open-a-usd-stage-from-a-path-containing-utf-8-chars/2459/2 "2025-05-16T15:13:46Z")

</div>

Hi @glukoz, what version of OpenUSD are you using? Do you know what the format of layer you’re trying to open is? (ie. usdc vs. usda)

---

<div class="post-metadata">

**Author:** ![glukoz](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@glukoz](https://forum.aousd.org/u/glukoz)\
**Post date:** [May 16, 2025, 3:42pm UTC](https://forum.aousd.org/t/cannot-open-a-usd-stage-from-a-path-containing-utf-8-chars/2459/3 "2025-05-16T15:42:54Z")

</div>

I am opening a usdc file.

The OpenUSD version is 25.02. I am building it from sources on my own.

---

<div class="post-metadata">

**Author:** ![nvmkuruc](https://avatars.discourse-cdn.com/v4/letter/n/76d3ee/32.png) [@nvmkuruc](https://forum.aousd.org/u/nvmkuruc)\
**Post date:** [May 16, 2025, 5:00pm UTC](https://forum.aousd.org/t/cannot-open-a-usd-stage-from-a-path-containing-utf-8-chars/2459/4 "2025-05-16T17:00:04Z")

</div>

@glukoz Have you tried a usda file by any chance?

I wonder if you’re running into the issue fixed here in 25.05-- [Fix ArchGetFileName on windows for file paths with special characters by mnaehrig · Pull Request #3545 · PixarAnimationStudios/OpenUSD](https://github.com/PixarAnimationStudios/OpenUSD/pull/3545)

---

<div class="post-metadata">

**Author:** ![glukoz](https://avatars.discourse-cdn.com/v4/letter/g/e47c2d/32.png) [@glukoz](https://forum.aousd.org/u/glukoz)\
**Post date:** [May 19, 2025, 9:55am UTC](https://forum.aousd.org/t/cannot-open-a-usd-stage-from-a-path-containing-utf-8-chars/2459/5 "2025-05-19T09:55:13Z")

</div>

That was it! I upgraded to version 25.05 and the problem is now solved.

Thank you for your help!
