Page 1 of 1

OS.execute and ANSI character

Posted: Monday 27 April 2020 17:05
by Yann
I looked on all forums and couldn't find the answer so I count on you :-)
I would like to execute this simple command based on gnotify that I installed on my windows server.
If I run it from the windows CMD line:
gnotify -H 192.168.1.26 -l fr température
Everything works well, I can hear "température" on my google home

Now in domoticz, I run the following:
os.execute('gnotify -H 192.168.1.26 -l fr température')
Google home doesn't pronounce it the right way (like additional special characters are inserted)
I looked on the console windows and see the following:
Status: dzVents: Info: gnotify -H 192.168.1.26 -l fr temp├®rature

So my problem is some kind of ANSI conversion issue when the command is sent by os.execute - don't know how to solve it .... any idea ?

Re: OS.execute and ANSI character

Posted: Monday 27 April 2020 21:54
by waaren
Yann wrote: Monday 27 April 2020 17:05 So my problem is some kind of ANSI conversion issue when the command is sent by os.execute - don't know how to solve it .... any idea ?
Could it be related to this forum post ?

Re: OS.execute and ANSI character

Posted: Monday 27 April 2020 23:11
by Yann
Unfortunately no ..... I am using internal Domoticz editor for dzVents, not an external one, so there is no UTF-8 parameter to set.
To be sure, I tested with the log function, and it is properly displayed in the log.
It is really the os.execute function that somehow changes the characters.