FitTrackee icon indicating copy to clipboard operation
FitTrackee copied to clipboard

Cannot use non-ascii chars in workout title

Open maciejla opened this issue 1 year ago • 4 comments

Hi, I'm creating the issue because it seems like only ASCII characters are accepted in the workout title field :( the error I got is:

2024/10/29 17:00:24 - fittrackee - ERROR - 'ascii' codec can't encode character '\u0144' in position 4: ordinal not in range(128)

It would be awesome if you could support all unicode characters :)

maciejla avatar Oct 29 '24 17:10 maciejla

Hi,

The issue may be related to system encoding or locale. Is the locale a non-UTF-8 locale?

SamR1 avatar Oct 30 '24 15:10 SamR1

Hi, unfortunately I don't think that's the issue. The OS is Debian 12 on LXC with the configuration as close to default as possible, so the locale was set to C:

root@fittrackee:~# cat /etc/default/locale 
LANG="C"

I changed that to en_US.UTF-8:

root@fittrackee:~# nano /etc/default/locale
root@fittrackee:~# nano /etc/locale.gen
root@fittrackee:~# locale-gen
Generating locales (this might take a while)...
  en_US.UTF-8... done
Generation complete.
root@fittrackee:~# reboot

after reboot:

root@fittrackee:~# locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

however, the error still exists :(

maciejla avatar Nov 04 '24 17:11 maciejla

Hi,

Thanks for the detailed answer.

For the moment, I have not been able to reproduce the issue. I tried with a fresh install on Docker (without any changes, by default LANG value is C.UTF-8):

root@031dec1ccebb:/usr/src/app# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
root@031dec1ccebb:/usr/src/app# locale
LANG=C.UTF-8
LANGUAGE=
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=

I was able to add non-ASCII characters in workout title: image No problem either with a gpx file containing non-ASCII characters in the title.

The error occurs on upload or workout edition?

SamR1 avatar Nov 09 '24 10:11 SamR1

The error occurs on both upload and edition. I will reinstall FitTrackee on a clean LXC and try to reproduce the error :)

maciejla avatar Nov 12 '24 18:11 maciejla