Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/inference/src/cpp/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ std::string find_plugins_xml(const std::string& xml_file) {
return xml_file_name;
}
}
const auto ov_library_path = ov::util::get_ov_lib_path();

// get_ov_lib_path() returns UTF-8 encoded string when UNICODE support is enabled
const auto ov_library_path_str = ov::util::get_ov_lib_path();

#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you provide some unit test for get_ov_lib_path with sample path which create an issue.

Errors will probably exist on windows with some special characters only.

ov::util::Path ov_library_path = std::filesystem::u8path(ov_library_path_str);
#else
ov::util::Path ov_library_path = ov::util::Path(ov_library_path_str);
#endif

// plugins xml can be found in either:
// 1. openvino-X.Y.Z relative to libopenvino.so folder
Expand Down Expand Up @@ -79,6 +87,7 @@ Core::Core(const std::string& xml_config_file) {

std::map<std::string, Version> Core::get_versions(const std::string& device_name) const {
OV_CORE_CALL_STATEMENT({ return _impl->get_versions(device_name); })}

#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
std::shared_ptr<ov::Model> Core::read_model(const std::wstring& model_path,
const std::wstring& bin_path,
Expand Down
Loading