diff options
Diffstat (limited to 'Alc/helpers.c')
-rw-r--r-- | Alc/helpers.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Alc/helpers.c b/Alc/helpers.c index 5d39f3d8..ac0826f2 100644 --- a/Alc/helpers.c +++ b/Alc/helpers.c @@ -1149,6 +1149,17 @@ void alstr_append_wcstr(al_string *str, const wchar_t *from) } } +void alstr_copy_wrange(al_string *str, const wchar_t *from, const wchar_t *to) +{ + int len; + if((len=WideCharToMultiByte(CP_UTF8, 0, from, (int)(to-from), NULL, 0, NULL, NULL)) > 0) + { + VECTOR_RESIZE(*str, len, len+1); + WideCharToMultiByte(CP_UTF8, 0, from, (int)(to-from), &VECTOR_FRONT(*str), len+1, NULL, NULL); + VECTOR_ELEM(*str, len) = 0; + } +} + void alstr_append_wrange(al_string *str, const wchar_t *from, const wchar_t *to) { int len; |