diff --git a/src/Main/fg_commands.cxx b/src/Main/fg_commands.cxx index 77132cc99..ac0133834 100644 --- a/src/Main/fg_commands.cxx +++ b/src/Main/fg_commands.cxx @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -295,7 +296,7 @@ do_load (const SGPropertyNode * arg) return false; } - ifstream input(validated_path.c_str()); + sg_ifstream input(SGPath::fromUtf8(validated_path)); if (input.good() && fgLoadFlight(input)) { input.close(); SG_LOG(SG_INPUT, SG_INFO, "Restored flight from " << file); diff --git a/src/Scripting/NasalSys.cxx b/src/Scripting/NasalSys.cxx index 2d3d56868..20b97849c 100644 --- a/src/Scripting/NasalSys.cxx +++ b/src/Scripting/NasalSys.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -726,7 +727,7 @@ static naRef f_parsexml(naContext c, naRef me, int argc, naRef* args) naRuntimeError(c, "parsexml(): access denied (unauthorized directory)"); return naNil(); } - std::ifstream input(file.c_str()); + sg_ifstream input(SGPath::fromUtf8(file)); NasalXMLVisitor visitor(c, argc, args); try { readXML(input, visitor);