Skip to content

Commit

Permalink
Force device name to UTF-8 in legacy Mac OS X target.
Browse files Browse the repository at this point in the history
We expect these strings to be UTF-8 when reported to the app, and I've got
 a device here that's coming up with Unicode characters in it.

This already uses UTF-8 in the Mac OS X 10.5+ target, this was just a leftover
 from the cut-and-pasted HUD Utilities code.
  • Loading branch information
icculus committed Jul 9, 2011
1 parent 409f61b commit a2df25c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion macosx_hidutilities.c
Expand Up @@ -581,7 +581,9 @@ static void hid_GetDeviceInfo (io_object_t hidDevice, CFMutableDictionaryRef hid
refCF = CFDictionaryGetValue (usbProperties, CFSTR("USB Product Name"));
if (refCF)
{
if (!CFStringGetCString (refCF, pDevice->product, 256, CFStringGetSystemEncoding ()))
// ryan forced this to UTF-8.
//if (!CFStringGetCString (refCF, pDevice->product, 256, CFStringGetSystemEncoding ()))
if (!CFStringGetCString (refCF, pDevice->product, 256, kCFStringEncodingUTF8))
HIDReportError ("CFStringGetCString error retrieving pDevice->product.");
}

Expand Down

0 comments on commit a2df25c

Please sign in to comment.