X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fwchar.cpp;h=e9c98ed8478d305bcd40bf1bc396d3db85c4156b;hb=4f049544ec827a9f1f16a913d7241f29179fdde7;hp=872c87a254bdc303192fef376217a8c829c92b80;hpb=2dfe078cf4082caf641c96449907f36a9029b486;p=guile-irrlicht.git diff --git a/src/wchar.cpp b/src/wchar.cpp index 872c87a..e9c98ed 100644 --- a/src/wchar.cpp +++ b/src/wchar.cpp @@ -23,11 +23,14 @@ #include #include "wchar.h" -wchar_t* +SCM +scm_from_wide_char_string (const wchar_t* text) +{ + 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); }