Skip to content

Commit

Permalink
DIRECTOR: decode movie paths before loading
Browse files Browse the repository at this point in the history
  • Loading branch information
mistydemeo committed Nov 9, 2021
1 parent dc5992a commit 7c6df35
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion engines/director/resource.cpp
Expand Up @@ -153,7 +153,7 @@ void Window::probeMacBinary(MacArchive *archive) {
if (num == 0)
error("No strings in Projector file");

Common::String sname = name->readPascalString();
Common::String sname = decodePlatformEncoding(name->readPascalString());
Common::String moviePath = pathMakeRelative(sname);
if (testPath(moviePath)) {
_nextMovie.movie = moviePath;
Expand Down
4 changes: 4 additions & 0 deletions engines/director/util.cpp
Expand Up @@ -983,4 +983,8 @@ Common::String castTypeToString(const CastType &type) {
return res;
}

Common::String decodePlatformEncoding(Common::String input) {
return input.decode(g_director->getPlatformEncoding());
}

} // End of namespace Director
2 changes: 2 additions & 0 deletions engines/director/util.h
Expand Up @@ -97,6 +97,8 @@ Common::String encodePathForDump(const Common::String &path);

Common::String utf8ToPrintable(const Common::String &str);

Common::String decodePlatformEncoding(Common::String input);

} // End of namespace Director

#endif

0 comments on commit 7c6df35

Please sign in to comment.