Welcome to the new home of the Cumulus Support forum.

Latest Cumulus release v1.9.4 (build 1099) - Nov 28 2014
Latest Cumulus MX release - v3.0.0 build 3043 Jan 20 2017. See the Wiki for download

Problem with degrees symbol

Discussion of version 3 of Cumulus, which runs on Windows, Linux, and OS X. All Cumulus MX queries in here, please.
User avatar
Mapantz
Posts: 514
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Problem with degrees symbol

Post by Mapantz » Tue Jun 05, 2018 1:32 pm

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?
Image
Image

ExperiMentor
Posts: 45
Joined: Tue Nov 24, 2015 11:30 pm
Weather Station: Fine Offset
Operating System: Windows 7; Linux
Location: Switzerland

Re: Problem with degrees symbol

Post by ExperiMentor » Tue Jun 05, 2018 9:19 pm

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?

User avatar
steve
Cumulus Author
Posts: 26713
Joined: Mon Jun 02, 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Problem with degrees symbol

Post by steve » Tue Jun 05, 2018 9:33 pm

You may need to restart MX to get the 'utf=8' setting to take effect.
Steve

User avatar
Mapantz
Posts: 514
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Problem with degrees symbol

Post by Mapantz » Tue Jun 05, 2018 10:07 pm

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.
Image
Image

User avatar
mcrossley
Posts: 5206
Joined: Thu Jan 07, 2010 9:44 pm
Weather Station: Davis VP2
Operating System: Stretch Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Problem with degrees symbol

Post by mcrossley » Tue Jun 05, 2018 10:35 pm

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.

User avatar
steve
Cumulus Author
Posts: 26713
Joined: Mon Jun 02, 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Problem with degrees symbol

Post by steve » Wed Jun 06, 2018 7:57 am

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.
Steve

User avatar
Mapantz
Posts: 514
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Problem with degrees symbol

Post by Mapantz » Wed Jun 06, 2018 8:54 am

Hi Steve

I'm using the .txt file extension.
It is set to UTF-8 as well.
ipcamT.txt
You do not have the required permissions to view the files attached to this post.
Image
Image

User avatar
steve
Cumulus Author
Posts: 26713
Joined: Mon Jun 02, 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Problem with degrees symbol

Post by steve » Wed Jun 06, 2018 10:27 am

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.
You do not have the required permissions to view the files attached to this post.
Steve

User avatar
Mapantz
Posts: 514
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Problem with degrees symbol

Post by Mapantz » Wed Jun 06, 2018 11:37 am

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
You do not have the required permissions to view the files attached to this post.
Image
Image

User avatar
steve
Cumulus Author
Posts: 26713
Joined: Mon Jun 02, 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Problem with degrees symbol

Post by steve » Wed Jun 06, 2018 11:41 am

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.
Steve

User avatar
Mapantz
Posts: 514
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Problem with degrees symbol

Post by Mapantz » Wed Jun 06, 2018 11:56 am

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.
Image
Image

User avatar
beteljuice
Posts: 2497
Joined: Tue Dec 09, 2008 1:37 pm
Weather Station: None !
Operating System: XP SP3 - honest
Location: Dudley, West Midlands, UK

Re: Problem with degrees symbol

Post by beteljuice » Wed Jun 06, 2018 7:38 pm

Shouidn't it be UTF8 NO BOM ?
Image
......................Imagine, what you will KNOW tomorrow !

User avatar
Mapantz
Posts: 514
Joined: Sat Dec 17, 2011 11:55 am
Weather Station: Davis Vantage Pro2
Operating System: Windows 10 x64 - A beast.
Location: Wareham, Dorset - UK
Contact:

Re: Problem with degrees symbol

Post by Mapantz » Thu Jun 07, 2018 12:04 pm

beteljuice wrote:Shouidn't it be UTF8 NO BOM ?
Tried UFT8 on it's own, with BOM and ANSI. All ideas have exhausted lol
Image
Image

User avatar
steve
Cumulus Author
Posts: 26713
Joined: Mon Jun 02, 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: Problem with degrees symbol

Post by steve » Thu Jun 07, 2018 12:51 pm

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.
Steve

User avatar
ConligWX
Posts: 721
Joined: Mon May 19, 2014 10:45 pm
Weather Station: Davis Vantage Pro2 Plus
Operating System: Debian 9.5 Stretch
Location: Bangor, NI
Contact:

Re: Problem with degrees symbol

Post by ConligWX » Thu Jun 07, 2018 1:19 pm

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.
You do not have the required permissions to view the files attached to this post.
Regards Simon

https://www.conligwx.org
https://twitter.com/conligwx
Davis Vantage Pro2 Plus - CumulusMX v3.0.0 (build 3043) + Saratoga/PWS Templates

Post Reply