Page 1 of 2

Bad reading nooa monthly e yearly report

Posted: Thu 07 Nov 2019 12:12 am
by Nevizio
Hi, everyone,i see the noaa monthly and yearly report that show stranger simbol next to C°(indicated by the red arrow) maybe i can correct but how? :?:

Re: Bad reading nooa monthly e yearly report

Posted: Thu 07 Nov 2019 9:02 am
by mcrossley
How are you viewing them?

It is a difference in character encoding schemes between the file and viewer.

Re: Bad reading nooa monthly e yearly report

Posted: Thu 07 Nov 2019 10:03 am
by Nevizio
this is the files report that cumulus mx show in reports interface and in the remote file on te my web site,how can modificate? :roll: :?:

Re: Bad reading nooa monthly e yearly report

Posted: Thu 07 Nov 2019 10:07 am
by mcrossley
I'd need to see your web page to advise, you need to post a link.

How have you configured MX to save the report - using UTF-8 encoding or not?

Re: Bad reading nooa monthly e yearly report

Posted: Thu 07 Nov 2019 10:09 am
by HansR
@Mark: Actually, it may be a bit different, funny thing is, I checked it myself this morning and was wondering what had happened. It is originally coded as on the page as: 'weird char' °C. I think it has originally been a two byte char where the intention was to do it correctly with a ° But the weird char remained and the °seems to have been placed in between. If you look at the source of the page you will see this. I am not sure where the reports are generated. I have a different layout but the char is there as well.

Re: Bad reading nooa monthly e yearly report

Posted: Thu 07 Nov 2019 10:19 am
by mcrossley
HansR wrote: Thu 07 Nov 2019 10:09 am where the intention was to do it correctly with a °
The NOAA file should not use HTML encoding, this is a plain text file.

If you have an encoding mismatch between the NOAA file contents and a HTML page you display it in then you will get these odd characters - it is not a corruption in the file itself. Open the file in a text editor and it will display correctly because it will adapt its encoding based on what it finds in the file.

The MX Admin interface uses HTML5 and UTF-8 encoding (the standard for HTML5), so if the NOAA reports are generated in ASCII encoding, you will see odd characters, there is not a lot I can do about that.

Re: Bad reading nooa monthly e yearly report

Posted: Thu 07 Nov 2019 10:30 am
by Nevizio
mcrossley wrote: Thu 07 Nov 2019 10:07 am I'd need to see your web page to advise, you need to post a link.

How have you configured MX to save the report - using UTF-8 encoding or not?
http://www.collineaprutinemeteodue.alte ... MO1119.txt
I use UTF-8 encoding but I send the NOOA files online with the extra web file interface because using the interface where you set the files nooa the same does not work for uploads (the reason I have not yet figured it out)

Re: Bad reading nooa monthly e yearly report

Posted: Thu 07 Nov 2019 10:33 am
by Nevizio
mcrossley wrote: Thu 07 Nov 2019 10:19 am
HansR wrote: Thu 07 Nov 2019 10:09 am where the intention was to do it correctly with a °
The NOAA file should not use HTML encoding, this is a plain text file.

If you have an encoding mismatch between the NOAA file contents and a HTML page you display it in then you will get these odd characters - it is not a corruption in the file itself. Open the file in a text editor and it will display correctly because it will adapt its encoding based on what it finds in the file.

The MX Admin interface uses HTML5 and UTF-8 encoding (the standard for HTML5), so if the NOAA reports are generated in ASCII encoding, you will see odd characters, there is not a lot I can do about that.
No wait I did it already, I opened the file with windows 10 notepad but the strange character is there, I was about to delete it manually but then I stopped because I thought I would do damage .... :?

Re: Bad reading nooa monthly e yearly report

Posted: Thu 07 Nov 2019 11:00 am
by mcrossley
Please zip up the files and attach them here so I can examine the encoding being used.

Re: Bad reading nooa monthly e yearly report

Posted: Thu 07 Nov 2019 11:04 am
by mcrossley
Nevizio wrote: Thu 07 Nov 2019 10:30 am I use UTF-8 encoding but I send the NOOA files online with the extra web file interface because using the interface where you set the files nooa the same does not work for uploads (the reason I have not yet figured it out)
I'm wondering if the FTP process is corrupting the files, try ticking the "binary" option in the extra files configuration.
Some FTP servers can corrupt UTF-8 when doing "Text" transfers - they only use basic ASCII encoding.

Re: Bad reading nooa monthly e yearly report

Posted: Thu 07 Nov 2019 11:22 am
by Nevizio
mcrossley wrote: Thu 07 Nov 2019 11:00 am Please zip up the files and attach them here so I can examine the encoding being used.

Re: Bad reading nooa monthly e yearly report

Posted: Thu 07 Nov 2019 11:24 am
by Nevizio
mcrossley wrote: Thu 07 Nov 2019 11:04 am
Nevizio wrote: Thu 07 Nov 2019 10:30 am I use UTF-8 encoding but I send the NOOA files online with the extra web file interface because using the interface where you set the files nooa the same does not work for uploads (the reason I have not yet figured it out)
I'm wondering if the FTP process is corrupting the files, try ticking the "binary" option in the extra files configuration.
Some FTP servers can corrupt UTF-8 when doing "Text" transfers - they only use basic ASCII encoding.
Ok I Try ;)
Thank you.

Re: Bad reading nooa monthly e yearly report

Posted: Thu 07 Nov 2019 11:25 am
by Nevizio
Another question I noticed in the dashboard interface but also in gauge (below I posted the image with the red arrow indicating the maximum value shown) the maximum value of the wind speed is 40 Km / h, as you can 'change this value?

Re: Bad reading nooa monthly e yearly report

Posted: Thu 07 Nov 2019 11:56 am
by mcrossley
Nevizio wrote: Thu 07 Nov 2019 11:25 am Another question I noticed in the dashboard interface but also in gauge (below I posted the image with the red arrow indicating the maximum value shown) the maximum value of the wind speed is 40 Km / h, as you can 'change this value?
A can of worms!

Short answer yes, in gauges.js

Change "windScaleDefMaxKmh" to what ever you want. (line 119 in the interface version of gauges.js)

But the code will change the max value depending on the data it is given - it will automatically increase the value as the wind speed approaches the current max value - and and what numbers will give a nice spread of figures and tickmarks.

Re: Bad reading nooa monthly e yearly report

Posted: Thu 07 Nov 2019 12:20 pm
by HansR
mcrossley wrote: Thu 07 Nov 2019 10:19 am
HansR wrote: Thu 07 Nov 2019 10:09 am where the intention was to do it correctly with a °
The NOAA file should not use HTML encoding, this is a plain text file.

If you have an encoding mismatch between the NOAA file contents and a HTML page you display it in then you will get these odd characters - it is not a corruption in the file itself. Open the file in a text editor and it will display correctly because it will adapt its encoding based on what it finds in the file.

The MX Admin interface uses HTML5 and UTF-8 encoding (the standard for HTML5), so if the NOAA reports are generated in ASCII encoding, you will see odd characters, there is not a lot I can do about that.
It probably is not a CMX problem but a web template issue.
I just checked where it comes from - I use the Saratoga template myself - and the part of the code that displays the report is a bit upgraded by beteljuice. He entered the following code on three places :

Code: Select all

$rpt = preg_replace('|<|Uis','&lt;',$rpt);
$rpt = preg_replace('|>|Uis','&gt;',$rpt);
$rpt = preg_replace('|°|Uis','&deg;',$rpt);
echo $rpt;
So the original txt file (no HTML) is reformatted to straight forward HTML (within a <pre> tag).

I think beteljuice must take a look at it.