aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2013-09-19 19:13:13 +0200
committerSverker Eriksson <[email protected]>2013-09-19 19:13:13 +0200
commit6fea2c436a6f4a501be632e9bb7453570c09fb8e (patch)
tree9f21aca3d6136647553d6fedbe4cb0fdcc737d2f /erts/emulator/beam/erl_nif.c
parentf7c9b020f21d57bceddc8596faa275be20625557 (diff)
downloadotp-6fea2c436a6f4a501be632e9bb7453570c09fb8e.tar.gz
otp-6fea2c436a6f4a501be632e9bb7453570c09fb8e.tar.bz2
otp-6fea2c436a6f4a501be632e9bb7453570c09fb8e.zip
erts, crypto: Support NIF library with unicode filename on windows
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r--erts/emulator/beam/erl_nif.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 9e2e588161..e87959f0ab 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -1568,7 +1568,7 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
void* init_func = NULL;
ErlNifEntry* entry = NULL;
ErlNifEnv env;
- int i, err;
+ int i, err, encoding;
Module* mod;
Eterm mod_atom;
const Atom* mod_atomp;
@@ -1580,8 +1580,14 @@ BIF_RETTYPE load_nif_2(BIF_ALIST_2)
struct erl_module_nif* lib = NULL;
int reload_warning = 0;
- lib_name = erts_convert_filename_to_native(BIF_ARG_1, NULL, 0,
- ERTS_ALC_T_TMP, 1, 0, NULL);
+ encoding = erts_get_native_filename_encoding();
+ if (encoding == ERL_FILENAME_WIN_WCHAR) {
+ /* Do not convert the lib name to utf-16le yet, do that in win32 specific code */
+ /* since lib_name is used in error messages */
+ encoding = ERL_FILENAME_UTF8;
+ }
+ lib_name = erts_convert_filename_to_encoding(BIF_ARG_1, NULL, 0,
+ ERTS_ALC_T_TMP, 1, 0, encoding, NULL);
if (!lib_name) {
BIF_ERROR(BIF_P, BADARG);
}