diff options
author | Patrik Nyblom <[email protected]> | 2012-07-26 18:35:46 +0200 |
---|---|---|
committer | Patrik Nyblom <[email protected]> | 2012-08-14 15:04:06 +0200 |
commit | e11bbb37273ebd2408d0c83c62770f9ef023879d (patch) | |
tree | 58ca0f2f6381e171c7c99ba3022a25c137f7b689 /erts/preloaded | |
parent | 0c9d90f314f364e5b1301ec89d762baabc57c7aa (diff) | |
download | otp-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')
-rw-r--r-- | erts/preloaded/ebin/init.beam | bin | 48064 -> 48292 bytes | |||
-rw-r--r-- | erts/preloaded/src/init.erl | 6 |
2 files changed, 5 insertions, 1 deletions
diff --git a/erts/preloaded/ebin/init.beam b/erts/preloaded/ebin/init.beam Binary files differindex cc170b86b2..9f2d369af2 100644 --- a/erts/preloaded/ebin/init.beam +++ b/erts/preloaded/ebin/init.beam 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) -> |