diff options
Diffstat (limited to 'src/coding.c')
| -rw-r--r-- | src/coding.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/coding.c b/src/coding.c index d6560a92b70..c18632f301b 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -286,6 +286,10 @@ encode_coding_XXX (struct coding_system *coding) | |||
| 286 | #include <config.h> | 286 | #include <config.h> |
| 287 | #include <stdio.h> | 287 | #include <stdio.h> |
| 288 | 288 | ||
| 289 | #ifdef HAVE_WCHAR_H | ||
| 290 | #include <wchar.h> | ||
| 291 | #endif /* HAVE_WCHAR_H */ | ||
| 292 | |||
| 289 | #include "lisp.h" | 293 | #include "lisp.h" |
| 290 | #include "character.h" | 294 | #include "character.h" |
| 291 | #include "buffer.h" | 295 | #include "buffer.h" |
| @@ -8003,6 +8007,16 @@ from_unicode (Lisp_Object str) | |||
| 8003 | return code_convert_string_norecord (str, Qutf_16le, 0); | 8007 | return code_convert_string_norecord (str, Qutf_16le, 0); |
| 8004 | } | 8008 | } |
| 8005 | 8009 | ||
| 8010 | Lisp_Object | ||
| 8011 | from_unicode_buffer (const wchar_t* wstr) | ||
| 8012 | { | ||
| 8013 | return from_unicode ( | ||
| 8014 | make_unibyte_string ( | ||
| 8015 | (char*) wstr, | ||
| 8016 | /* we get one of the two final 0 bytes for free. */ | ||
| 8017 | 1 + sizeof (wchar_t) * wcslen (wstr))); | ||
| 8018 | } | ||
| 8019 | |||
| 8006 | wchar_t * | 8020 | wchar_t * |
| 8007 | to_unicode (Lisp_Object str, Lisp_Object *buf) | 8021 | to_unicode (Lisp_Object str, Lisp_Object *buf) |
| 8008 | { | 8022 | { |