diff options
author | Heiko Hund <heiko.hund@sophos.com> | 2011-12-07 18:59:21 +0100 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2012-02-05 17:24:19 +0100 |
commit | a23f8579d37186559d3e1f6cd87a27b2331d4766 (patch) | |
tree | 2573426ee5b3a78beab6b9668e925d62da7789a5 | |
parent | 04d66ef064d5ac1ade4b30329b87239aac95d821 (diff) | |
download | openvpn-a23f8579d37186559d3e1f6cd87a27b2331d4766.tar.gz openvpn-a23f8579d37186559d3e1f6cd87a27b2331d4766.tar.xz openvpn-a23f8579d37186559d3e1f6cd87a27b2331d4766.zip |
set Windows environment variables as UCS-2
Windows uses 16 bit wide characters to represent Unicode in the
process environment. Convert UTF-8 to UCS-2 and use the wide
character API to set environment variables.
Signed-off-by: Heiko Hund <heiko.hund@sophos.com>
-rw-r--r-- | misc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1082,8 +1082,8 @@ setenv_str_ex (struct env_set *es, { #if defined(WIN32) { - /*msg (M_INFO, "SetEnvironmentVariable '%s' '%s'", name_tmp, val_tmp ? val_tmp : "NULL");*/ - if (!SetEnvironmentVariable (name_tmp, val_tmp)) + if (!SetEnvironmentVariableW (wide_string (name_tmp, &gc), + wide_string (val_tmp, &gc))) msg (M_WARN | M_ERRNO, "SetEnvironmentVariable failed, name='%s', value='%s'", name_tmp, val_tmp ? val_tmp : "NULL"); |