Page 14 of 19

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Wed 25 Sep 2013 3:00 pm
by stewart45
Think you might be right there, will have a look at " include"

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sat 05 Apr 2014 8:55 am
by mm23
Hi everybody,

I have a some kind of unusually problem here. I manually save my noaa reports as utf 8 and upload it on server. When I open files in mozilla i can not see degree sign and some other signs (š, ž .....) These signs "appears" normally everywhere (on my pc a.g) except from my server.

http://www.vrijemeusibeniku.com/weather ... 2014&mo=02


Any help?

Thanks!

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sat 05 Apr 2014 9:29 am
by steve
I think the problem is that your 'viewer' page is not UTF-8

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

If you view the files directly, they display OK, e.g. http://www.vrijemeusibeniku.com/weather ... MO0114.txt

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sat 05 Apr 2014 9:35 am
by mm23
Thanks Steve,

I figure out that. Everything seems ok when I changed the mozilla encoding from some western to utf 8, but when I refresh page the western encoding comes back again....

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sat 05 Apr 2014 10:19 am
by beteljuice
Aha ... an old 'hangover' !

You are using the page as a stand-alone rather than included in a site template and you have 'foreign' characters.

You need to change this line in the code:

Code: Select all

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
// should be
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sat 05 Apr 2014 10:22 am
by mm23
...similar problem:
http://forums.mozillazine.org/viewtopic ... 7&t=683425

and also one bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=158285

What should I do now Steve?.....any suggestion?

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sat 05 Apr 2014 10:31 am
by mm23
Well done beteljuice!!

It works!

Thanks.............

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sun 04 May 2014 6:58 pm
by mm23
Hi!

Have one problem with Noaa reports....
My NOAA reports were working well until the beginning of this month. Now I have the situation that on the Cumulus PC NOAA report for May works ok, also in the annual summary for this month on web server (Internet).... but the monthly file on the server is empty.....?

http://www.vrijemeusibeniku.com/weather ... 2014&mo=05

I did not touch anything....

Somebody, please?

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sun 04 May 2014 7:55 pm
by steve
This isn't anything to do with the viewer, a new thread would have been better. The file should get uploaded every night, just after midnight. Has it been the same every day this month, or is today the first day that it's been empty? If it's OK on your PC, then presumably there was some kind of ftp error last night. It may get uploaded correctly tonight.

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sun 04 May 2014 8:17 pm
by mm23
I'm not sure but I think this is happening since the beginning of the month ...
I have no idea why this happened. It is difficult to assume that every night occurs the same ftp error .... or not?

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sun 04 May 2014 10:12 pm
by steve
The only way to find out is to do the same thing as for any possible ftp problem - turn on ftp logging.

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Mon 05 May 2014 6:26 am
by mm23
Steve,

It was too late last night for what you suggestion, and now it seems that everything is okay. By the way, what time NOAAH files uploaded? I guess it depends on the Web update interval?
I'll follow it and see how things regarding NOAAH files will develop further.........

Thanks for help....

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Mon 05 May 2014 6:39 am
by steve
mm23 wrote:By the way, what time NOAAH files uploaded? I guess it depends on the Web update interval?
On the next upload, as it says in the help.

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sun 07 Dec 2014 11:03 am
by duke
@beteljuice

I have changed my NOAA page to show the full menu and it has thrown up the strange black diamond error again even though I added your 'Nasty work_around' (your words not mine) when you suggested way back in 'this post'.

Code: Select all

// Replace following code to prevent degree symbol being replaced with black diamond symbol
//
// if($rpt){
//	echo "<pre>\n";
//	echo preg_replace('|<|Uis','<',$rpt);
//	echo "</pre>\n";
//}
//echo "</div> <!-- END noaa_rep_container -->\n";

if($rpt){

// NASTY work-around, the ONLY way I find black diamond question mark (or deg character)
   $checkIt = explode("(", $rpt);
   $dodgy = substr($checkIt[1],0 , 1);

// the ONLY way I can replace when black diamond (unconditionally) to &deg
   $rpt = str_replace($dodgy,'&deg;',$rpt);
// END nasty work around


   echo "<pre>\n";
   echo preg_replace('|<|Uis','<',$rpt);
   echo "</pre>\n";
}
echo "</div> <!-- END noaa_rep_container -->\n";
What's different this time is that the black diamond only shows for the current year and not past years. You can take a look 'here'

Any suggestions? Note, I am using this in a page declared as html & UTF-8

EDIT: I have just discovered that this only applies to reports generated from September 2013 onward which happens to coincide with Steves release of 'Cumulus 1.9.4 (build 1085) ' which has the option for UTF-8 encoding - which I do. Although I do not see any difference in the reports when viewed in notepad++.

Re: PHP Web 'viewer' for Cumulus NOAA Style reports

Posted: Sun 07 Dec 2014 11:28 am
by duke
OK, I put fingers to keyboard too soon. Removing your work-around and saving the older reports as UTF-8 resolves this issue.