Author Topic: NOAA Report Problem  (Read 274 times)

0 Members and 1 Guest are viewing this topic.

Offline griffo42

  • Senior Member
  • **
  • Posts: 58
    • Carina Weather
NOAA Report Problem
« on: January 09, 2018, 07:09:24 AM »
Hi all

I am using the Saratoga templates and Cumulus.

The NOAA report prepared by Cumulus correctly shows the "degree" symbol - see the attachment NOAA Report - Cumulus.

To get the Cumulus report into my Saratoga based website I run the program NOAAReportssaratoga.php.  The report which then appears in my website does not show the "degree" symbol at all - see the attachment NOAAReport - Saratoga.

Am I using the correct software to get from Cumulus to Saratoga for this?  If not, please suggest the correct one to use.

Otherwise can someone please suggest a fix so that the "degree" symbol is shown correctly in the Saratoga report and thus on my website.

Thanks

griffo42 [ You are not allowed to view attachments ]  [ You are not allowed to view attachments ]

Keith Griffin, Brisbane, QLD AUSTRALIA; Web Site http://www.kstwx.net/index.php
Davis VantageVUE  Model #6357
Cumulus v1.9.4-b1099
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 166
Re: NOAA Report Problem
« Reply #1 on: January 09, 2018, 07:41:21 AM »
This has to do with the Character encoding on your page.  I had that happen and couldn't get it to cooperate so I added this code as a workaround:

Code: [Select]
<?php
ini_set
('default_charset'"");
?>

Ken can tell you how to fix it the right way but that worked for me.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6350
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Report Problem
« Reply #2 on: January 09, 2018, 11:55:14 AM »
The page in the iframe NOAA-reportssaratoga.php is coming in as UTF-8, and needs to be in ISO-8859-1 to display the degree symbol.

Insert in your php.ini in the document root of your website.

default_charset = "ISO-8859-1"

and that should fix the issue.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline griffo42

  • Senior Member
  • **
  • Posts: 58
    • Carina Weather
Re: NOAA Report Problem
« Reply #3 on: January 10, 2018, 07:29:31 PM »
Hi Ken

Thanks for your advice to fix my problem, however I must not have done it correctly as the problem is not fixed. 

This is the report of this morning.  [ You are not allowed to view attachments ]
This is a scan cut of my website's root directory.  The php.ini file is in the folder "etc". [ You are not allowed to view attachments ]
Here in the attachment is the php.ini file.

I seem to have done something incorrectly.  Please suggest a fix in the light of all of this, if you are able to.

Thanks

griffo42 (Keith)

Ed.note: removed 3rd attachment-it was a view-source of a wxforum.net page, not a php.ini file.
« Last Edit: January 11, 2018, 10:53:19 AM by saratogaWX »
Keith Griffin, Brisbane, QLD AUSTRALIA; Web Site http://www.kstwx.net/index.php
Davis VantageVUE  Model #6357
Cumulus v1.9.4-b1099
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 166
Re: NOAA Report Problem
« Reply #4 on: January 11, 2018, 07:23:49 AM »
Your experience mirrors mine.  I made all the changes that were obvious to me regarding the default_charset to no avail.  I too must have missed something.  I then resorted to adding the code I mentioned earlier in this thread to the top of the script and the issue was resolved.  As I said, this isn't the best way to fix it but it did work for me.  I have had so many issues since moving to PHP 7+ and I wonder if that may be the reason this suddenly started happening.

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6350
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Report Problem
« Reply #5 on: January 11, 2018, 10:54:38 AM »
The php.ini file would be in your public_html directory (which, according to the screen capture, is likely your website's document root).
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 166
Re: NOAA Report Problem
« Reply #6 on: January 11, 2018, 11:25:50 AM »
In my case, this is the entry that defines charset:

Code: [Select]
; PHP's default character set is set to empty.
; http://php.net/default-charset
; default_charset = "UTF-8"

While UTF-8 is the problem I was under the impression that by leaving it blank or commenting it out would allow scripts, etc. to define the character set as needed for each one.  Am I off with my thinking?

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6350
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: NOAA Report Problem
« Reply #7 on: January 11, 2018, 11:38:25 AM »
Sometimes, it's the Apache httpd.conf that sets a default character set (if the PHP doesn't).   The PHP order of processing is the master php.ini, then overrides by the php.ini in the document root (if any).   PHP 7+ defaults to UTF-8 if it's not explicitly specified.  PHP 5 used ISO-8859-1 default if not explicitly specified.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline tmabell

  • Senior Contributor
  • ****
  • Posts: 166
Re: NOAA Report Problem
« Reply #8 on: January 11, 2018, 11:46:20 AM »
Now I understand.  That would explain why the degree symbol got strange after the PHP upgrade to 7.  Thanks very much Ken, I will make the needed changes.

EDIT:  That fixed the issue!
« Last Edit: January 11, 2018, 11:52:39 AM by tmabell »

Offline griffo42

  • Senior Member
  • **
  • Posts: 58
    • Carina Weather
Re: NOAA Report Problem
« Reply #9 on: January 11, 2018, 08:41:36 PM »
Despite copying the php.ini file from the 0:/etc folder to 0:/ root  and/or to my 0:/public_html folder none of these worked for me. 

I tried tmabell's fix shown in his first post and that works for me. 

It annoys me that I can't fix it according to Ken's suggestions but I don't know enough about programming in PHP.

Thanks to both for all your help.

griffo42 (Keith)
Keith Griffin, Brisbane, QLD AUSTRALIA; Web Site http://www.kstwx.net/index.php
Davis VantageVUE  Model #6357
Cumulus v1.9.4-b1099
Saratoga Weather World template Cumulus plugin
Carina Weather, Brisbane.