use WIN_StringToUTF8W macro instead of WIN_StringToUTF8, where needed:

i.e. where the string is known guaranteed to be WCHAR*, in:
- SDL_dinputjoystick.c (WIN_IsXInputDevice): VARIANT->var is BSTR (WCHAR*)
- SDL_rawinputjoystick.c (RAWINPUT_AddDevice): string is WCHAR*
- SDL_windows_gaming_input.c (IEventHandler_CRawGameControllerVtbl_InvokeAdded):
  string is WCHAR*

There should be more of these..
This commit is contained in:
Ozkan Sezer 2021-01-04 10:00:30 +03:00
parent 5b14bbff5f
commit a594b85031
3 changed files with 4 additions and 4 deletions

View file

@ -733,10 +733,10 @@ RAWINPUT_AddDevice(HANDLE hDevice)
WCHAR string[128];
if (SDL_HidD_GetManufacturerString(hFile, string, sizeof(string))) {
manufacturer_string = WIN_StringToUTF8(string);
manufacturer_string = WIN_StringToUTF8W(string);
}
if (SDL_HidD_GetProductString(hFile, string, sizeof(string))) {
product_string = WIN_StringToUTF8(string);
product_string = WIN_StringToUTF8W(string);
}
device->name = SDL_CreateJoystickName(device->vendor_id, device->product_id, manufacturer_string, product_string);