Skip to content

Conversation

@jorpelae
Copy link

Fix for #1284

MediaPipe seems to fail to load assets from folders containing Japanese characters on Windows. After debugging the C++ side, couldn't find any obvious problem without going into MediaPipe itself.

As a workaround, I added a step to check if the asset path contains non-ASCII characters, and if this is the case, make a copy to a temporary path.

@jorpelae
Copy link
Author

@homuler Do you think this can be merged?

@homuler
Copy link
Owner

homuler commented Dec 26, 2025

Sorry for the delay, I forgot to check this 🙇‍♂️
I think it would be better to fix this issue on the C++ side, so I’ll take some time to look into it by the end of this year.

if (PathHasNonAsciiChars(filePath))
{
string tempFilePath = Path.Combine(Path.GetTempPath(), Path.GetFileName(filePath));
File.Copy(filePath, tempFilePath, true);
Copy link
Owner

@homuler homuler Dec 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we end up implementing a workaround on the C# side, it might make sense to change the _CacheRoot value so that the path contains only ASCII characters, since PathAsResourceFile is not expected to have side effects.

_CachePathRoot = Path.Combine(Application.persistentDataPath, _RelativePath);

@jorpelae
Copy link
Author

Sorry for the delay, I forgot to check this 🙇‍♂️ I think it would be better to fix this issue on the C++ side, so I’ll take some time to look into it by the end of this year.

Thank you for your time for looking into this.
I was not able to find any obvious fix on the C++ and attributed the crash to MediaPipe itself.
Of course if C++ side can be fixed that could be a better solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

If the file path contains characters other than English, the camera will not function.

2 participants