Audio Device names should be cared as UTF-8


#1

Hi Jules,

I found a problem in juce_mac_CoreAudio.cpp in JUCE v1.41.

In the line 1081 and 1083,

log (T("CoreAudio device: ") + String (name)); names.add (String (name));
should be

log (T("CoreAudio device: ") + String::fromUTF8((const uint8*)name, strlen(name))); names.add (String::fromUTF8((const uint8*)name, strlen(name)));
because CoreAudio returns those property as UTF-8 formatted string. For example, when the application has Japanese resources and the OS language setting also be Japanese wrong text is displayed.

By my correction, device names are displayed in Japanese characters properly.

But once I’ve fixed this issue, AudioDeviceManager become export wrong string in the XML file like this:

I don’t know who is doing this wrong text conversion for the device name. Could you let me know where should I fix?

Best regards,
Masanao Hayashi


#2

Ah - thanks Hayashi, you’re quite right about the UTF8.

The XML problem is a bug I’d already fixed, and which will be in the next release. Hopefully I’ll be able to get that out pretty soon!


#3