X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fwchar.cpp;h=a41a00313569681ab7de4d97dff80519aa881c05;hb=87e6d9b96167c5db7ef3c824b47c0d575b0fc4d2;hp=872c87a254bdc303192fef376217a8c829c92b80;hpb=2dfe078cf4082caf641c96449907f36a9029b486;p=guile-irrlicht.git diff --git a/src/wchar.cpp b/src/wchar.cpp index 872c87a..a41a003 100644 --- a/src/wchar.cpp +++ b/src/wchar.cpp @@ -23,7 +23,16 @@ #include #include "wchar.h" -wchar_t* +SCM +scm_from_wide_char_string (const wchar_t* wtext) +{ + size_t nbytes = wcslen (wtext) + 1; + char* ctext = (char*)malloc (nbytes); + wcstombs (ctext, wtext, nbytes); + return scm_from_utf8_string (ctext); +} + +const wchar_t* scm_to_wide_char_string (SCM text) { char* ctext = scm_to_utf8_stringn (text, NULL);