aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/emacs-module.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 643633935ca..a24d85537bd 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -393,10 +393,8 @@ module_make_function (emacs_env *env, ptrdiff_t min_arity, ptrdiff_t max_arity,
393 else 393 else
394 { 394 {
395 ptrdiff_t nbytes = strlen (documentation); 395 ptrdiff_t nbytes = strlen (documentation);
396 ptrdiff_t nchars, ignored_nbytes; 396 doc = make_unibyte_string (documentation, nbytes);
397 parse_str_as_multibyte ((unsigned char const *) documentation, nbytes, 397 doc = code_convert_string_norecord (doc, Qutf_8, false);
398 &nchars, &ignored_nbytes);
399 doc = make_multibyte_string (documentation, nchars, nbytes);
400 } 398 }
401 399
402 Lisp_Object ret = list4 (Qlambda, 400 Lisp_Object ret = list4 (Qlambda,
@@ -555,8 +553,7 @@ module_copy_string_contents (emacs_env *env, emacs_value value, char *buffer,
555 } 553 }
556 554
557 *length = required_buf_size; 555 *length = required_buf_size;
558 memcpy (buffer, SDATA (lisp_str_utf8), raw_size); 556 memcpy (buffer, SDATA (lisp_str_utf8), raw_size + 1);
559 buffer[raw_size] = 0;
560 557
561 return true; 558 return true;
562} 559}
@@ -572,10 +569,9 @@ module_make_string (emacs_env *env, const char *str, ptrdiff_t length)
572 module_non_local_exit_signal_1 (env, Qoverflow_error, Qnil); 569 module_non_local_exit_signal_1 (env, Qoverflow_error, Qnil);
573 return NULL; 570 return NULL;
574 } 571 }
575 ptrdiff_t nchars, ignored_nbytes; 572 Lisp_Object lstr = make_unibyte_string (str, length);
576 parse_str_as_multibyte ((unsigned char const *) str, length, 573 return lisp_to_value (env,
577 &nchars, &ignored_nbytes); 574 code_convert_string_norecord (lstr, Qutf_8, false));
578 return lisp_to_value (env, make_multibyte_string (str, nchars, length));
579} 575}
580 576
581static emacs_value 577static emacs_value