Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

NOAA Reports °C not displaying correctly

Discussion and questions about Cumulus weather station software version 1. This section is the main place to get help with Cumulus 1 software developed by Steve Loft that ceased development in November 2014.
Post Reply
apple8
Posts: 129
Joined: Sun 21 Aug 2011 2:26 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10
Location: Sydney. Australia
Contact:

NOAA Reports °C not displaying correctly

Post by apple8 »

Just noticed that in the NOAA reports the °C is showing as ?C with the ? in a black diamond. The degree symbol shows correctly in the web pages and within the Cumulus software in View NOAA Reports.

Any ideas on the cause and a fix?
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: NOAA Reports °C not displaying correctly

Post by steve »

Your report files are ANSI encoded, but your viewer page http://www.blazingcomet.com/weather/NOAA-reports.php is being sent by the web server as utf-8, despite the fact that you have <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> in there. My expertise doesn't extend so far as to be able to tell you why that is, or what you need to do to correct it. Changing to utf-8 for the reports would presumably make the problem go away, but if it were me, I'd want to know why the web page is being treated as utf-8 when it shouldn't be. My guess would be some kind of configuration issue with the web server.
Steve
apple8
Posts: 129
Joined: Sun 21 Aug 2011 2:26 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10
Location: Sydney. Australia
Contact:

Re: NOAA Reports °C not displaying correctly

Post by apple8 »

I am a bit out of my depth here and am trying to think what might have changed, so, would this recent email from my web host be related.

Our senior technicians will be upgrading PHP on this server to the latest PHP 5.6.x string for improved security and performance. We will be making these changes on Monday, 11th of July 2016 at 10:00PM AEST.
We understand that some customers applications will not support PHP 5.6, however we have made the PHP selector available so you can downgrade to a lower version of PHP to restore your website.
User avatar
mcrossley
Posts: 12683
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: NOAA Reports °C not displaying correctly

Post by mcrossley »

The web server is configured to send php pages back as UTF-8, this is what it is supplying in the response header...

Code: Select all

Content-Type:text/html; charset=UTF-8
The <meta> tag in the page header is just advisory, browsers use the response header first, deferring to the meta tag if the server response doesn't contain encoding information.

UTF-8 encoding is pretty much the standard nowadays, and is the default for HTML5.

You either have to change the web server default settings (unlikely to happen), or as your host is using a LiteSpeed web server you should be able to add an .htaccess file to your root folder to set the default encoding for your site. You'd need to add something like...

Code: Select all

# This prevents web browsers or spiders from seeing your .htaccess directives:
<Files .htaccess>
	deny from all
</Files>

AddDefaultCharset iso-8859-1
AddCharset iso-8859-1 .php
AddCharset windows-1252 .txt
apple8
Posts: 129
Joined: Sun 21 Aug 2011 2:26 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10
Location: Sydney. Australia
Contact:

Re: NOAA Reports °C not displaying correctly

Post by apple8 »

Thanks for the suggestions, I thought I would try what last worked and down graded the PHP version to 5.5 which proved successful.

I guess there is a subtle difference in the latest version that affected the display of characters.
User avatar
steve
Cumulus Author
Posts: 26702
Joined: Mon 02 Jun 2008 6:49 pm
Weather Station: None
Operating System: None
Location: Vienne, France
Contact:

Re: NOAA Reports °C not displaying correctly

Post by steve »

The difference is that the HTTP headers being sent by the server no longer contain "charset=UTF-8" so your <meta> tag is no longer being overridden, and so the page is being correctly interpreted as iso-8859-1.

Apparently, the default charset in PHP 5.6 changed from "empty" to utf-8, see https://www.saotn.org/php-56-default_ch ... ml-output/ for example.
Steve
apple8
Posts: 129
Joined: Sun 21 Aug 2011 2:26 am
Weather Station: Davis Vantage Vue
Operating System: Windows 10
Location: Sydney. Australia
Contact:

Re: NOAA Reports °C not displaying correctly

Post by apple8 »

I dug up this old post as the problem came to the fore again when the PHP version on my host was updated to the latest version (see above posts).

This time I believe I have resolved it and my solution may be of help to others (although I am probably the last one to know about this solution). :)

First, in the NOAA setup I ticked the Use UTF-8 box and all files uploaded since then are ok and display the degree symbol correctly.

That was a few months ago, but then I realised when I was doing some updating to my web pages that the ten years prior were still a problem. I did a search and found a convert text files to UTF-8 tool. I downloaded the files from the server in batches to a folder and let the converter do its thing. It adds its URL to the file name which is batch removed and loaded back to the server.

Only took me 5 years.
Post Reply