Version: 2.0.0 (using KDE 4.6.2) OS: Linux Reproducible: Always Steps to Reproduce: * enter the "import from camera" dialog * show the camera info through "Device" / "Information" * select "Summary" and look at the text on the right side Actual Results: The german "umlaut" characters are not shown. Example: "Fähigkeiten des Geräts:" Expected Results: should be: "Fähigkeiten des Geräts:" Looks like either an i18n error or some QString::(to|from)(Local8Bit|Utf8) or similar is missing when setting the text box on the right side.
Yes, i remember to have seen something similar with my old Minolta camera, through Gphoto2 PTP driver. These string come from Gphoto2. Something is wrong in this library. Gilles Caulier
Ok, I wouldn't go so far to say that there is something wrong in that library. The question rather is "which string encoding does their API offer?" I did a quick look at the libgphoto2 sources, but I did not see any note about a concrete "encoding". It seems that they use just "char*" and the strings contain "translated text" (at least the comments in the code says so). That means for digikam, that whenever receives such a string from the library, it probably needs to be converted it by using QString::fromLocal8Bit(), fromUtf8() or similar. My system here is configured to use UTF-8 as native encoding, so I guess that fromLocal8Bit(...) might be a good choice. Could you please give this a try? Thomas
Thomas, If you use git master source code, the function from digiKam Gphoto2 interface relevant of this problem is there : https://projects.kde.org/projects/extragear/graphics/digikam/repository/revisions/master/entry/utilities/cameragui/devices/gpcamera.cpp#L1365 Feel free to test and provide a patch if you find the right solution... Thanks in advance Gilles Caulier
I'm sure Marcus can enlighten us whether to use fromLocal8Bit() instead of fromAscii() for the text from gp_camera_get_summary...
libgphoto2 uses bindtextdomain() when initializing abilities, so it uses the system locale and encoding. So for LANG=de_DE.utf8 it will get UTF-8. not sure which exact QT function this expresses, but I would also like to know as kcmshell4 kamera has the same problem.
Thanks Marcus. QString::fromLocal8Bit() should be using the current locale settings.
Git commit e0123e4ba0f7848ea85f2e84e2dcfe4fd8aa17ec by Marcel Wiesweg. Committed on 11/06/2011 at 22:52. Pushed by mwiesweg into branch 'master'. Use fromLocal8Bit to convert gphoto2's strings to QString BUG: 272180 M +2 -1 NEWS M +4 -4 utilities/cameragui/devices/gpcamera.cpp http://commits.kde.org/digikam/e0123e4ba0f7848ea85f2e84e2dcfe4fd8aa17ec
untested, no device, but it really should work.
I applied this patch to my local copy of digikam-2.0.0_beta5 and can confirm that it works fine now, all strings are shown in the right encoding (which is UTF-8 in my case). thanks for fixing, Thomas.