summaryrefslogtreecommitdiffstats
path: root/platform/windows
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-05-04 13:12:05 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-05-04 13:12:05 -0300
commit7f5b744b92256e42aa3c700ee88d8318732935c6 (patch)
treea8adec6d7cdca1a05b6aa4f2451d08ce8a24fea0 /platform/windows
parentad634876b5b7d775f6d490cf7f874c6aae058a28 (diff)
downloadredot-engine-7f5b744b92256e42aa3c700ee88d8318732935c6.tar.gz
small unicode fixes
Diffstat (limited to 'platform/windows')
-rw-r--r--platform/windows/os_windows.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 414c250bd4..534d62664b 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -2110,12 +2110,13 @@ bool OS_Windows::has_environment(const String& p_var) const {
String OS_Windows::get_environment(const String& p_var) const {
- char* val = getenv(p_var.utf8().get_data());
- if (val)
- return val;
-
+ wchar_t wval[0x7Fff]; // MSDN says 32767 char is the maximum
+ int wlen = GetEnvironmentVariableW(p_var.c_str(),wval,0x7Fff);
+ if ( wlen > 0 ) {
+ return wval;
+ }
return "";
-};
+}
String OS_Windows::get_stdin_string(bool p_block) {