Summary: | Camera Device Summary seems to use wrong encoding | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Thomas Eschenbacher <Thomas.Eschenbacher> |
Component: | Import-Gphoto2 | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | caulier.gilles, marcus |
Priority: | NOR | ||
Version: | 2.0.0 | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 2.0.0 | |
Sentry Crash Report: |
Description
Thomas Eschenbacher
2011-05-01 19:43:54 UTC
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. |