X-Git-Url: https://git.jsancho.org/?p=guile-irrlicht.git;a=blobdiff_plain;f=src%2Fwchar.cpp;h=e9c98ed8478d305bcd40bf1bc396d3db85c4156b;hp=a41a00313569681ab7de4d97dff80519aa881c05;hb=4f049544ec827a9f1f16a913d7241f29179fdde7;hpb=c4d9e46f268b4f7f738dd77685c632991125cec9 diff --git a/src/wchar.cpp b/src/wchar.cpp index a41a003..e9c98ed 100644 --- a/src/wchar.cpp +++ b/src/wchar.cpp @@ -24,19 +24,13 @@ #include "wchar.h" SCM -scm_from_wide_char_string (const wchar_t* wtext) +scm_from_wide_char_string (const wchar_t* text) { - size_t nbytes = wcslen (wtext) + 1; - char* ctext = (char*)malloc (nbytes); - wcstombs (ctext, wtext, nbytes); - return scm_from_utf8_string (ctext); + return scm_from_utf32_string ((const scm_t_wchar*) text); } const wchar_t* scm_to_wide_char_string (SCM text) { - char* ctext = scm_to_utf8_stringn (text, NULL); - wchar_t* wtext = (wchar_t*)malloc ((strlen (ctext) + 1) * sizeof (wchar_t)); - mbstowcs (wtext, ctext, strlen (ctext) + 1); - return wtext; + return (const wchar_t*) scm_to_utf32_string (text); }