New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate encodings and localisation #39
Comments
I don't have much C experience (and less with the locales, only heard bad things about it), but isn't there a function like Sorry if what I'm saying makes no sense at all :/ |
Wait nevermind, libgphoto2 already does that: https://github.com/gphoto/libgphoto2/blob/master/ChangeLog#L2249 |
Yeah it does, as well as it has an internal function for overriding the encoding specifically. All I'm saying is that it's worth testing and adding whatever's necessary to make sure that Unicode strings from camera are correctly parsed and converted to UTF-8 that Rust expects regardless of |
If you have camera at hand and it allows settings some strings (e.g. Canon allows to set copyright author name via Digital Photo Professional), it would be good to set that to e.g. Chinese characters, overriding |
I added an example to test this, unfortunately my camera (a Nikon D3400) does not seem to have any text that I can freely set. If you have a camera where you can set a text, just adjust the |
It should have the same copyright field (https://www.dummies.com/article/home-auto-hobbies/photography/add-copyright-notice-images-nikon-d5600-245525/), but seems like it can be set only from the camera, which likely means no Unicode chars. |
Actually, one other thing you could do is just create a file with unicode chars via file manager when camera is connected, and then checking how it's reported via |
My camera sadly only exposes images to
Will we? AFAICT we are using |
Those I count as corruption :P
Hm, are you saying that manually added files via file manager are not visible via CameraFS? Fascinating. |
Anyway, I'll add some unicode chars to the virtual camera to make this easier to verify. |
WDYM? I haven't found any writable |
I mean in libgphoto2 itself :) |
I've been looking a bit into how libgphoto2 deals with encodings, and found that it actually respects system localisation + some undocumented APIs for overriding localisation/encodings. What worries me there is that I'm not certain that non-English strings are guaranteed to be encoded in UTF-8 by libgphoto2, in which case perhaps we don't have a right to return them as String, or perhaps we at least have to customize encoding upon startup to enforce UTF-8 or something... As I said, I only started looking at this and there's a bit of uncertainty here. Now that I added test framework, I think it would be helpful to try and verify those assumptions and check what happens with non-ASCII characters.
Originally posted by @RReverser in #27 (comment)
The text was updated successfully, but these errors were encountered: