Page 1 of 2

Problem with degrees symbol

Posted: Tue 05 Jun 2018 1:32 pm
by Mapantz
Hi there!

After all the kerfuffle about Wunderground stopping the free API, I suddenly realised IPTimelapse uses it to show the weather data. I then discovered on another forum, that IPTimelapse can read a text file for the weather data. So, I have set up a text file called ipcamT.txt and get CMX to process a few webtags and turn it in to ipcam.txt, IPTimelapse reads that text file. The problem I have is the degrees symbol, If I use either °or <#tempunit> then Cumulus turns it either to 15.8�C or 15.8À°C or 15.8&#176;C

I have tried saving in ANSI and UTF-8, but it still won't show a simple °C

What am I doing wrong?

Edit: I have just been doing some experimenting.. I stopped Cumulus from processing the file, then opened the file in notepad and saved it as UTF-8. As soon as IPTimelapse read the file, it correctly showed the degrees symbol without any extra weird characters. I checked 'UTF8' in Cumulus and restarted the file processing and it added in the weird characters again. I'm wondering if CMX is actually using UTF8 at all?

Re: Problem with degrees symbol

Posted: Tue 05 Jun 2018 9:19 pm
by ExperiMentor
I have 2 answers for you.

First, Unicode has 2 symbols, see https://en.wikipedia.org/wiki/Celsius . There is either a code for the little circle degree symbol that you put a C after, or there is a different code that combines the degree and C into a single character. Have you tried both?

Second, correct usage (though little known) is that the degree symbol should not be used. You are supposed to just write "19.7 C" and that nicely avoids all your troubles! I think Cumulus' <#tempunit> just gives you the C or F for that reason?

Re: Problem with degrees symbol

Posted: Tue 05 Jun 2018 9:33 pm
by steve
You may need to restart MX to get the 'utf=8' setting to take effect.

Re: Problem with degrees symbol

Posted: Tue 05 Jun 2018 10:07 pm
by Mapantz
ExperiMentor wrote: Second, correct usage (though little known) is that the degree symbol should not be used. You are supposed to just write "19.7 C" and that nicely avoids all your troubles! I think Cumulus' <#tempunit> just gives you the C or F for that reason?
I'm old school. I like to show °C

<#tempunit> shows °C <#tempunitnodeg> shows C
steve wrote:You may need to restart MX to get the 'utf=8' setting to take effect.
Sadly, that didn't work Steve. I still get °C

I spoke to another user earlier, he is doing the same thing as me, but using Cumulus 1.9.4 build 1099, he has no problems with the encoding.

Re: Problem with degrees symbol

Posted: Tue 05 Jun 2018 10:35 pm
by mcrossley
ExperiMentor wrote:Second, correct usage (though little known) is that the degree symbol should not be used. You are supposed to just write "19.7 C" and that nicely avoids all your troubles! I think Cumulus' <#tempunit> just gives you the C or F for that reason?
Can't agree with that ;)
It is "degrees Celsius" and should have a degree symbol (separated from the value by a space) - the same for Fahrenheit. The SI unit however is just "Kelvin" and that does not have a degree symbol.

Re: Problem with degrees symbol

Posted: Wed 06 Jun 2018 7:57 am
by steve
I’m pretty sure the utf-8 processing works, because the standard templates use utf-8. Perhaps there’s a problem with utf-8 for extra files - assuming of course that your input file is OK.

When I next have my laptop out I’ll have a look. But note that &#176; as you quoted above is a valid HTML entity for a degree symbol and should be rendered correctly by a browser.

Re: Problem with degrees symbol

Posted: Wed 06 Jun 2018 8:54 am
by Mapantz
Hi Steve

I'm using the .txt file extension.
It is set to UTF-8 as well.
ipcamT.txt

Re: Problem with degrees symbol

Posted: Wed 06 Jun 2018 10:27 am
by steve
The file you attached doesn't use <#tempunit>, nor does it have a degree symbol in it. I edited it (in Notepad++) to use both of those:
2018-06-06 12_19_59-C__Users_steve_Downloads_ipcamT.txt - Notepad++.png
For me, MX substitutes &#176; for the degree symbol in the web tag (which is correct for a web site) and leaves the explicit degree symbol untouched:
2018-06-06 12_20_42-_C__Users_steve_Downloads_ipcam.txt - Notepad++.png
I don't know why it apparently doesn't work for you. I don't think the code has changed in this area in the version I'm using compared to build 3043. Note that MX creates the output file as UTF-8 without BOM, perhaps that's relevant.

Re: Problem with degrees symbol

Posted: Wed 06 Jun 2018 11:37 am
by Mapantz
Yeah sorry. I forgot to put back what I was trying to use as I removed it just to keep 'C'

That aside, using &#176; stays as &#176; in the output.

If I stop CMX from processing the file and manually put the degrees symbol in, it works fine, but as soon as CMX processes the file again, it adds °C to the output.

Processing stopped and manually put degrees symbol in output file:
2018-06-06 (4).png
Processing started again:
2018-06-06 (3).png

Re: Problem with degrees symbol

Posted: Wed 06 Jun 2018 11:41 am
by steve
Have you actually looked at the output file from Cumulus in Notepad++ (or another good text editor). Perhaps the problem is with whatever you are doing with it.

Re: Problem with degrees symbol

Posted: Wed 06 Jun 2018 11:56 am
by Mapantz
I'm doing nothing with the files. I have a simple ipcamT.txt which get's processed to ipcam.txt, and then the text get's read my the webcam software.

Both files show °C and both files are encoded with UTF-8 BOM (opened in NOTEPAD++)

If it was the webcam software, surely the degrees symbol wouldn't show when I manually add it to the text file? As it is the degrees symbol shows fine, so it seems like CMX doing something with it when it processes it. I can't think of anything else to be honest.

Re: Problem with degrees symbol

Posted: Wed 06 Jun 2018 7:38 pm
by beteljuice
Shouidn't it be UTF8 NO BOM ?

Re: Problem with degrees symbol

Posted: Thu 07 Jun 2018 12:04 pm
by Mapantz
beteljuice wrote:Shouidn't it be UTF8 NO BOM ?
Tried UFT8 on it's own, with BOM and ANSI. All ideas have exhausted lol

Re: Problem with degrees symbol

Posted: Thu 07 Jun 2018 12:51 pm
by steve
All I can tell you is that Cumulus is correctly encoding the degree symbol as the hex sequence C2 B0 (look at the output from Cumulus in a hex editor). That odd A symbol that you see is what you get when software incorrectly interprets the UTF-8 encoding as ANSI, so presumably that's what your webcam software is doing.

Perhaps your webcam software can't handle utf-8 files? If that's the case, then I think you're stuck, unless you can also turn off the 'use utf-8 for standard files' setting, because I seem to remember that due to some issue with a third party component, the utf-8 setting is either on or off for all files.

Re: Problem with degrees symbol

Posted: Thu 07 Jun 2018 1:19 pm
by ConligWX
no sure what to say really I created a template file for my webcam to use the °C symbol and then CumulsMX processes that for a txt file to be used with Imagiks "convert" utility.

the °C is handled by CumulsMX without any issue it doesnt get changed. here is my file and txt file unchanged.