Comments (12)
I mean in libgphoto2 itself :)
from gphoto2-rs.
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 setlocale
we can use to just set the locale to C
to get consistent results regardless of the operating's system locale?
Sorry if what I'm saying makes no sense at all :/
from gphoto2-rs.
Wait nevermind, libgphoto2 already does that: https://github.com/gphoto/libgphoto2/blob/master/ChangeLog#L2249
from gphoto2-rs.
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 LC_ALL=...
environment variable or any other settings (I suspect right now if user sets LC_ALL
to a non-UTF8 encoding, and there are non-ASCII strings, we'll get either corruption or runtime panics).
from gphoto2-rs.
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 LC_ALL
to some non-UTF8 encoding and checking how those characters are parsed by gphoto2-rs.
from gphoto2-rs.
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 CONFIG_KEY
in the example to the widget name.
from gphoto2-rs.
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.
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.
from gphoto2-rs.
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 CameraFS
?
from gphoto2-rs.
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 CameraFS?
My camera sadly only exposes images to libgphoto2
it has taken and match the naming format :(
I suspect right now if user sets LC_ALL to a non-UTF8 encoding, and there are non-ASCII strings, we'll get either corruption or runtime panics
Will we? AFAICT we are using String::from_utf8_lossy
wherever we get a string from libgphoto2, so invalid UTF-8 should not cause a pash
from gphoto2-rs.
so invalid UTF-8 should not cause a pash
Those I count as corruption :P
My camera sadly only exposes images to
libgphoto2
it has taken and match the naming format :(
Hm, are you saying that manually added files via file manager are not visible via CameraFS? Fascinating.
from gphoto2-rs.
Anyway, I'll add some unicode chars to the virtual camera to make this easier to verify.
from gphoto2-rs.
Anyway, I'll add some unicode chars to the virtual camera to make this easier to verify.
WDYM? I haven't found any writable TextWidget
on the Virtual camera. You don't seem to be able to create or upload files/directories on the virtual camera (the storage access type is RoDelete
)
from gphoto2-rs.
Related Issues (20)
- CameraFile::get_data is probably leaking memory HOT 5
- CameraFile shouldn't keep ownership of the original File HOT 1
- libgphoto2 has thread safety issues
- Memory unsoundness in port_info (and maybe others) HOT 8
- Hook up gp_log_add_func HOT 3
- Add ability to set context progress functions
- Add a way to upload file from in-memory slice HOT 5
- Consistent filesystem access? HOT 6
- libgphoto2 is actually not thread-safe at all :( HOT 11
- Problem with tauri HOT 2
- Example code in README.md does not work HOT 1
- Downloading previews
- 0 byte file left behind HOT 1
- Task future is not multithreading-friendly HOT 1
- [Solved] Compilation error on Linux Mint: 'stdarg.h' file not found HOT 2
- Mixed Widget types in error message. HOT 2
- Switch from log to tracing? HOT 2
- Interaction between Context::set_progress_handlers and Task::set_progress_handler
- String helpers have stack-use-after-return issues HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gphoto2-rs.