Page 7 of 49

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Posted: Thu 30 Apr 2020 9:44 pm
by Dennisdg
Thanks - all sorted now.

Cheers

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Posted: Thu 30 Apr 2020 10:10 pm
by BCJKiwi
NOOOO!!

There is NO line 355 in noaareports.php
The line at 293 should be

Code: Select all

echo preg_replace(array('/\xC2/U','/\xB0/U'), array('°','°'),$rpt);
The Howto clearly indicates the formats that should be used for the NOAA reports and the settings to use in extra webfiles.

This was tested with BOTH CumulusMX AND Cumulus1

There WAS a longstanding bug which we (beteljuice & myself) fixed with the above line.

If you use the settings specified in the Howto then it will work.
If it does NOT work then it is probably because historically some non-default settings were used to generate the files.
The files can be fixed by loading them in notepad++ and changing the encoding to ANSI CR LF
as all the files in both C1 and MX are formatted this way when the default setting are used.

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Posted: Fri 01 May 2020 8:02 am
by sfws
BCJKiwi wrote: Thu 30 Apr 2020 10:10 pm If you use the settings specified in the Howto then it will work.
If it does NOT work then it is probably because historically some non-default settings were used to generate the files.
Correct.

For Dennisdg, his settings were not as in your How To.
Sensibly, his setting selection gave him benefits of a bigger character set including degree symbol. Most people have web pages using UTF-8 and would therefore choose a consistent encoding for all files output from Cumulus.

Changing your preg_replace line was quicker and easier for him than him manually changing lots of NOAA reports to an inferior character set that you then change again to add back the characters he already had. That was right advice for him.

Agreed, anyone following your instructions should not have UTF-8 files and should not do the change I suggested. I will edit my earlier post to make that clearer.
BCJKiwi wrote: Thu 30 Apr 2020 10:10 pm The files can be fixed by loading them in notepad++ and changing the encoding to ANSI CR LF
as all the files in both C1 and MX are formatted this way when the default setting are used.
Incorrect.

The encoding you want people to use is ISO-8859-1.

That does cause problems for those not using English, because it restricts what characters can be output. It cannot output the degree symbol, nor accented letters used by many languages.

You have the right to write inconsistent code, but in my opinion if you want to display a file using ISO-8859-1, that is the encoding you should also use for noaareports.php (with its HTML and PHP), but actually your preg_replace is changing the report file so it is no longer in its original encoding, which is even more inconsistent.


EDIT: Cut out some of the quotes from previous post, and simplified my response accordingly.

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Posted: Fri 01 May 2020 9:13 am
by mcrossley
BCJKiwi wrote: Thu 30 Apr 2020 10:10 pm The files can be fixed by loading them in notepad++ and changing the encoding to ANSI CR LF
as all the files in both C1 and MX are formatted this way when the default setting are used.
Not in MX, the line ending depends which on the OS that is running MX, for Windows it will be CRLF, for Linux (and I assume macOS) it will be LF.

And to be picky, MX uses ISO-8859-1 encoding by default not ANSI, though for the purposes of the NOAA reports they are equivalent as the reports do not contain any of the extra characters in the ANSI character set.

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Posted: Fri 01 May 2020 10:39 am
by sfws
mcrossley wrote: Fri 01 May 2020 9:13 am Not in MX, the line ending depends which on the OS that is running MX, for Windows it will be CRLF, for Linux (and I assume macOS) it will be LF.
Yes, only Windows does double character for line ends. Actually, macOS uses CR only.
Both MacOS and Linux are derived from the Unix I learnt almost half a century ago, well before Windows had been invented. Microsoft deliberately chose to do everything a different way to what was internationally accepted. This deliberate incompatibility was part of forcing people to use their products.
mcrossley wrote: Fri 01 May 2020 9:13 am And to be picky, MX uses ISO-8859-1 encoding by default not ANSI, though for the purposes of the NOAA reports they are equivalent as the reports do not contain any of the extra characters in the ANSI character set.
Thanks for mentioning it. I initially had typed ISO-8859-1 encoding in my post, but subsequently I returned to post and edited it out as I thought it was adding a complication step too far given the length of the rest of my argument! But I have edited it back in now although I am calling it Unicode rather than ISO-8859-1 because that is how Beteljuice references it, in the commented out replace instructions left in the "noaareports.php" script.

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Posted: Fri 01 May 2020 3:31 pm
by Dennisdg
For sfws, once again I am grateful for you suggested fix.

In the UIwebsiteMX Howto I had left unchanged Use UTF-8 encoding ‘tick’ from my previous CumulusMX settings. I have now un-ticked it.
It was not a deliberate choice to ignore default settings, an error on my part.

"For NOAA-reports
Use the CumulusMX User interface Settings / NOAA report settings option
Time format click on 24 Hour radio button
Monthly filename format 'NOAAMO'MMyy'.txt'
Yearly filename format 'NOAAYR'yyyy'.txt'
Use UTF-8 encoding DO NOT TICK
Autosave after daily reset tick
Auto FTP after auto save tick
FTP directory httpdocs/mxtest/NOAA-reports"

I have changed back line 293 to the original code. I assume the NOAA Reports will only reflect this change after the next daily upload.

BCJKiwi - "The Howto clearly indicates the formats that should be used for the NOAA reports and the settings to use in extra webfiles"
I do not have NOAA settings in extra webfiles, should I? If so what settings? I can’t find reference to them in the Howto do.

Thank you all for your help.

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Posted: Fri 01 May 2020 5:12 pm
by sfws
There is still misunderstanding about how you choose the encoding in which NOAA reports are generated.
Dennisdg wrote: Fri 01 May 2020 3:31 pm "For NOAA-reports
Use the CumulusMX User interface Settings / NOAA report settings option
Time format click on 24 Hour radio button
Monthly filename format 'NOAAMO'MMyy'.txt'
Yearly filename format 'NOAAYR'yyyy'.txt'
Use UTF-8 encoding DO NOT TICK
Autosave after daily reset tick
Auto FTP after auto save tick
FTP directory httpdocs/mxtest/NOAA-reports"

I have changed back line 293 to the original code. I assume the NOAA Reports will only reflect this change after the next daily upload.
This relates to how the FTP deals with the file. That is what BCJKiwi has written to help you fill out the Extra Files screen, it is not a guide to how you select the encoding for the NOAA reports.

Whether the report is generated in
mcrossley wrote: Fri 01 May 2020 9:13 am MX uses ISO-8859-1 encoding by default
or in UTF-8 is determined in a different setting:
NOAA.PNG
Please note this illustration does not show the default settings, it illustrates how they could be set, for purposes of customisation.
Dennisdg wrote: Fri 01 May 2020 3:31 pm In the UIwebsiteMX Howto I had left unchanged Use UTF-8 encoding ‘tick’ from my previous CumulusMX settings. I have now un-ticked it.
It was not a deliberate choice to ignore default settings, an error on my part.
Finally, what you select in UTF8 column on the extra files settings, is supposed to match the format of the file you are asking Cumulus to upload, so Denisdg, you have now created an error situation. You are now telling FTP to process your NOAA report file that is not in the encoding represented by unticked state.

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Posted: Fri 01 May 2020 6:06 pm
by Dennisdg
I currently don't have NOAA included in the Extra web files settings. NOAA files are being sent to the web but being displayed with double degrees.

Should I revert back to ticking the Use UTF-8 encoding and also include NOAA in Extra web files without UTF8 set?

My original NOAA report settings were the same as yours.

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Posted: Sat 02 May 2020 6:35 am
by sutne
Multilingual is working everywhere except for the pop-up graphs on the gauges.
Any plans for those?

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Posted: Sat 02 May 2020 1:34 pm
by sutne
BCJKiwi wrote: Thu 30 Apr 2020 8:09 am It will be in the header so it is available on all pages.
I think it is logical to have the update date next to the update time; in the Time box AND the footer.

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Posted: Mon 04 May 2020 7:41 am
by sutne
My site is up and running with the new UI:
http://www.rjoandveret.no/webfilesMX/index.php

There is one error in Records:
Everywhere the Lowest Maximum Temperature shows the same value.

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Posted: Mon 04 May 2020 11:36 am
by Dennisdg
Your pop-up graphs on the gauges look good to me.

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Posted: Mon 04 May 2020 12:00 pm
by BCJKiwi
@ sutne

Yes Will review the source file and advise.

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Posted: Mon 04 May 2020 12:33 pm
by sutne
Dennisdg wrote: Mon 04 May 2020 11:36 am Your pop-up graphs on the gauges look good to me.
Yes, they look fine but the legend is in english when I change to other languages.

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Posted: Mon 04 May 2020 8:29 pm
by BCJKiwi
@ sutne
When I view your site the gauges pop up graph legends are in the language selected.