qjackctl
qjackctl copied to clipboard
Character issues on portaudio device list (utf-8 related?)
When listing devices via portaudio, if any of them contain non-ascii characters, there seems to be issues. Did not reproduce this myself, was reported to me by somebody else.
See the image below:
Ideas on the cause of this and possible fixes?
this part of code is probably @kmatheussen to blame :) maybe some QString::fromLocal8Bit(); fromUtf8() may fixit somewhere. cheers
https://github.com/rncbc/qjackctl/blob/master/src/qjackctlInterfaceComboBox.cpp#L225 seems to be the place to change. what is the best way to convert to qstring here? not too familiar with const-char to qstring conversions, in pyqt everything is a regular python string.
whole issue seems to go around correct source string encoding:
my 1st. guess would be to replace QString(pDeviceInfo->name)
with QString::fromUtf8(pDeviceInfo->name)
good luck ;)
cheers
I think this code is written by @sletz. :-) Anyway, googling the problem it seems like portaudio uses utf-8, so perhaps QString::fromUtf8 will work. I also found this code:
wchar_t wideName[MAX_PATH];
MultiByteToWideChar(CP_UTF8, 0, deviceInfo->name, -1, wideName, MAX_PATH-1);
at line 168 here: http://portaudio.com/docs/v19-doxydocs/pa__devs_8c_source.html
...so if QString::fromUtf8 doesn't work, something like this
wchar_t wideName[MAX_PATH];
MultiByteToWideChar(CP_UTF8, 0, deviceInfo->name, -1, wideName, MAX_PATH-1);
const QString sName = QString::fromWCharArray(wideName);
might.
@ReinholdH please try the installer from https://github.com/jackaudio/jack2-releases/releases/tag/untagged-6be5f7fb64c472ce364f and let us know if that fixes the issue for you.
The character set issue which is reported here still exists in this new build.
@ReinholdH please try https://github.com/jackaudio/jack2-releases/releases/tag/untagged-eb79ebd3d89359110044 This has the alternative approach as suggested by portaudio code. Thanks again!
Thx. But I do not see any difference. All issue are still there.
That's a bummer. So the issue might be in my Qt5 build perhaps. We will have to do the 1.9.15 jack2 release without a fix for this
Isn't it more likely that the name is not utf-8 in the portaudio driver than there is a problem your Qt5 build? I've basically given up trying to use char* in windows, I just use wchar_t everywhere.
On Thu, Oct 15, 2020 at 1:52 PM Filipe Coelho [email protected] wrote:
That's a bummer. So the issue might be in my Qt5 build perhaps. We will have to do the 1.9.15 jack2 release without a fix for this
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rncbc/qjackctl/issues/104#issuecomment-709236721, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIX3J2XTZWWVOULLNE7DZDSK3O6NANCNFSM4SMUEG4A .
Dont know yet. Will be best for me to try to find a way to reproduce first.
The Qt5 build I am using does not have ICU support, but for UTF-8 that should not be an issue I think.. Maybe @ReinholdH system is using some other encoding..?
I believe the charset is Windows-1252. See https://en.wikipedia.org/wiki/Windows-1252 This is the regular Windows charset for Western Euqope. But the issue is definitely not important.