+#if defined(WIN32) && defined(UNICODE)
+ std::wstring wenv_var = Kernel_Utils::utf8_decode_s(env_var);
+ if (const wchar_t* var = _wgetenv(wenv_var.c_str()))
+ {
+ std::wstring plugins = var;
+#else
+ if (const char* var = getenv(env_var))
+ {
+ std::string plugins = var;
+#endif
+ std::string::size_type from = 0, pos;
+ while (from < plugins.size())
+ {
+#if defined(WIN32) && defined(UNICODE)
+ pos = plugins.find(L':', from);
+ std::wstring plugin;
+#else
+ pos = plugins.find(':', from);
+ std::string plugin;
+#endif
+ if (pos != std::string::npos)
+ plugin = plugins.substr(from, pos - from);
+ else
+ plugin = plugins.substr(from), pos = plugins.size();
+ from = pos + 1;