06-25-2025 02:49 AM - edited 06-25-2025 02:50 AM
I've been using sqlite lib on Linux (i compile my app as a shared library and run it as a service in a dicker container) for a few years and all was good until I had to store string that have accented characters (à,ê, etc...)
I keep getting error 1396 "Cannot convert text from the source character set to the destination character set." from the UTF-8 to lv text primitive (or the LV text to UTF-8)
Doing this fails
Insert INTO Table(
Name)
VALUES(
'Musée National')
)
But if I read a database file that contains "Musée National" it works
I've just noticed 2 VIs (not exposed in the palette), and think they might help, has anyone used that?
I'm not sure what is the impact of these 2 attributes but I'll poke around
Any advise would be greatly appreciated
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
Solved! Go to Solution.
06-25-2025 02:50 PM
Do you know what Code Page your Linux System is set for? The error suggests some kind of mixup in code pages. If your Code Page is UTF-8, then you can use those two property nodes to tell the toolkit to assume all text is UTF-8 already, and skip using that function that errors.
06-26-2025 02:34 AM
Yes on Ubuntu my code page is UTF-8
I'm unsure about Ubuntu & Debian Containers config, I will check.
I must admit I'm a bit confused with this issue, in the end what works for me on Windows (I rarely use this esoteric OS with LabVIEW), Linux, Linux container, whether I'm in source or compiled app is this :
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
06-26-2025 03:24 AM - edited 06-26-2025 03:25 AM
I think I got the answer (from a well know LLM), as indeed, I was only having issue when running my service in a container.
The issue you're experiencing is that Docker containers, including Ubuntu containers, start with minimal locale configurations by default. When you run echo $LANG in a Docker container, it often returns empty or shows "POSIX" because the locale environment variables aren't properly set during container initialization.
Why This Happens in Docker Containers
Docker containers are designed to be lightweight and minimal. The base Ubuntu images strip out many default configurations, including locale settings, to reduce image size
. Unlike a full Ubuntu installation where locale is configured during setup, Docker containers start with bare-bones locale configuration where LANG and other locale variables are either unset or set to "POSIX
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus