aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src
diff options
context:
space:
mode:
authorPatrik Nyblom <[email protected]>2012-07-26 18:35:46 +0200
committerPatrik Nyblom <[email protected]>2012-08-14 15:04:06 +0200
commite11bbb37273ebd2408d0c83c62770f9ef023879d (patch)
tree58ca0f2f6381e171c7c99ba3022a25c137f7b689 /erts/preloaded/src
parent0c9d90f314f364e5b1301ec89d762baabc57c7aa (diff)
downloadotp-e11bbb37273ebd2408d0c83c62770f9ef023879d.tar.gz
otp-e11bbb37273ebd2408d0c83c62770f9ef023879d.tar.bz2
otp-e11bbb37273ebd2408d0c83c62770f9ef023879d.zip
Make get/putenv and erlexec understand Unicode
Putenv and getenv needs to convert to the proper environment strings in Unicode depending on platform and user settings for filename encoding. Also erlexec needs to pass environment strings in an appropriate way for kernel to pick up. All environment strings on the command line, as well as home directory, is now passed in UTF8 on windows and in whatever encoding you have on Unix, kernel tries to convert all parameters and environments from UTF8 before making strings.
Diffstat (limited to 'erts/preloaded/src')
-rw-r--r--erts/preloaded/src/init.erl6
1 files changed, 5 insertions, 1 deletions
diff --git a/erts/preloaded/src/init.erl b/erts/preloaded/src/init.erl
index c9c434dea0..708991e261 100644
--- a/erts/preloaded/src/init.erl
+++ b/erts/preloaded/src/init.erl
@@ -1252,7 +1252,11 @@ get_arguments([]) ->
[].
to_strings([H|T]) when is_atom(H) -> [atom_to_list(H)|to_strings(T)];
-to_strings([H|T]) when is_binary(H) -> [binary_to_list(H)|to_strings(T)];
+to_strings([H|T]) when is_binary(H) -> [try
+ unicode:characters_to_list(H,file:native_name_encoding())
+ catch
+ _:_ -> binary_to_list(H)
+ end|to_strings(T)];
to_strings([]) -> [].
get_argument(Arg,Flags) ->