Accented characters with log function [Solved]
Moderator: leecollings
-
Number8
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Accented characters with log function
Hello,
Is there a way to have accented characters correctly displayed with the log function? urlEncode does do the trick.
I'm currently running 2020.1 (build 11946)
Thank you
Is there a way to have accented characters correctly displayed with the log function? urlEncode does do the trick.
I'm currently running 2020.1 (build 11946)
Thank you
Debian buster on NUC and three RPi with buster.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Accented characters with log function
Not sure what you want what's not already available.Number8 wrote: Saturday 18 April 2020 13:43 Hello,
Is there a way to have accented characters correctly displayed with the log function? urlEncode does do the trick.
I'm currently running 2020.1 (build 11946)
Thank you
With this script I see all the expect characters (even more on my system then here on the forum
Code: Select all
return
{
on =
{
devices =
{
'myLogger'
}
},
execute = function (dz)
for char=25,999,9 do
dz.log('char ' .. char .. ': ' .. utf8.char(char) .. ', ' ..
char+1 .. ': ' .. utf8.char(char+1) .. ', ' ..
char+2 .. ': ' .. utf8.char(char+2) .. ', ' ..
char+3 .. ': ' .. utf8.char(char+3) .. ', ' ..
char+4 .. ': ' .. utf8.char(char+4) .. ', ' ..
char+5 .. ': ' .. utf8.char(char+5) .. ', ' ..
char+6 .. ': ' .. utf8.char(char+6) .. ', ' ..
char+7 .. ': ' .. utf8.char(char+7) .. ', ' ..
char+8 .. ': ' .. utf8.char(char+8) .. ', ' ..
char+9 .. ': ' .. utf8.char(char+8) .. ', ' ..
char+10 .. ': ' .. utf8.char(char+8))
end
dz.log('âéüÇ⌂àåç~' )
end
}- Spoiler: show
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
Number8
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Accented characters with log function
Thanks waaren. Weird. For example dz.log ('éèàù') outputs garbage characters. I'm running debian buster on a NUC. Does that make a difference?
Debian buster on NUC and three RPi with buster.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Accented characters with log function
No that's the same system I used to produce this output.Number8 wrote:Thanks waaren. Weird. For example dz.log ('éèàù') outputs garbage characters. I'm running debian buster on a NUC. Does that make a difference?
Maybe you need to install utf support on your system.
Best to Google on utf support Debian.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
Number8
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Accented characters with log function
Thanks waaren for helping. I had fr_FR.UTF-8 UFT-8 installed at first place. Since your post, I added fr_FR ISO-8859-1, fr_FR@euro ISO-8859-15 even the GB counterpart. No luck. At command line level, when an é is typed, it is correctly displayed.
Debian buster on NUC and three RPi with buster.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Accented characters with log function
Don't know if it is relevant but I have my domoticz language set to EnglishNumber8 wrote: Monday 20 April 2020 18:11 Thanks waaren for helping. I had fr_FR.UTF-8 UFT-8 installed at first place. Since your post, I added fr_FR ISO-8859-1, fr_FR@euro ISO-8859-15 even the GB counterpart. No luck. At command line level, when an é is typed, it is correctly displayed.
This is what I see on my CLI
Code: Select all
#locale -a
C
C.UTF-8
en_US.utf8
POSIX
Code: Select all
#cat /etc/default/locale
# File generated by update-locale
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
Number8
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Accented characters with log function
Locale command returns
locale -a outputs
cat /etc/default/locale outputs
I just had the idea to set Domoticz interface to English. No change.
Code: Select all
LANG=fr_FR.UTF-8
LANGUAGE=
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=
Code: Select all
C
C.UTF-8
en_GB
en_GB.iso88591
en_GB.iso885915
en_GB.utf8
french
fr_FR
fr_FR@euro
fr_FR.iso88591
fr_FR.iso885915@euro
fr_FR.utf8
POSIX
Code: Select all
LANG=fr_FR.UTF-8
Debian buster on NUC and three RPi with buster.
-
Number8
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Accented characters with log function
I have the same problem with Telegram. I just don't know where to look for.
Debian buster on NUC and three RPi with buster.
-
Number8
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Accented characters with log function
Default locale is set to English UTF8, Domoticz interface is set to English, same issue. System has been installed using French.
Debian buster on NUC and three RPi with buster.
-
Number8
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Accented characters with log function
Still trying to fix it. Any help would be very much appreciated. Using curl at prompt level returns expected characters and not garbage
Code: Select all
curl 'https://api.telegram.org/botBOT_ID/sendMessage?chat_id=mychatID&text=éèàç'
Debian buster on NUC and three RPi with buster.
-
Number8
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Accented characters with log function [Solved]
Eureka! My text editor was set as 1252 not UTF-8. Working now. Thanks again @waaren to help to troubleshoot
Debian buster on NUC and three RPi with buster.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Accented characters with log function
Just tested using dzVents notify method and do receive all the accented chars in Telegram. I tested with both the pre-compiled Binary as with my local compiled one.Number8 wrote: Saturday 25 April 2020 11:24 Still trying to fix it. Any help would be very much appreciated. Using curl at prompt level returns expected characters and not garbageCode: Select all
curl 'https://api.telegram.org/botBOT_ID/sendMessage?chat_id=mychatID&text=éèàç'
Did you also post this question at the french forum?
I guess more French speaking user are likely experienced this as the French language makes more use of accented chars compared to English or Dutch.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
Number8
- Posts: 374
- Joined: Friday 23 May 2014 7:55
- Target OS: Linux
- Domoticz version: 2022.1
- Location: Saint Pierre de Jards
- Contact:
Re: Accented characters with log function
at waaren I guess our messages were posted almost at the same time. See mine hereabove.
Debian buster on NUC and three RPi with buster.
Who is online
Users browsing this forum: Bing [Bot] and 1 guest