Commit 09164a01 authored by François Grisez's avatar François Grisez

Encode Wasapi sound card names into UTF-8

parent ce9da3ec
......@@ -477,10 +477,12 @@ static void add_or_update_card(MSSndCardManager *m, MSList **l, LPWSTR id, LPWST
char *name;
size_t inputlen;
size_t returnlen;
int err;
inputlen = wcslen(wname) + 1;
name = (char *)ms_malloc(inputlen);
if (wcstombs_s(&returnlen, name, inputlen, wname, inputlen) != 0) {
inputlen = wcslen(wname);
returnlen = inputlen * 2;
name = (char *)ms_malloc(returnlen);
if ((err = WideCharToMultiByte(CP_UTF8, 0, wname, -1, name, returnlen, NULL, NULL)) == 0) {
ms_error("mswasapi: Cannot convert card name to multi-byte string.");
return;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment