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 4019) - 03 April 2024

Legacy Cumulus 1 release 1.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

CumulusMX and Cumulus1 UI style Multilingual Websites

Discussion and support for 3rd-party (non-Sandaysoft) tools for Cumulus
Post Reply
Dennisdg
Posts: 220
Joined: Tue 07 Feb 2012 9:42 am
Weather Station: Davis Vantage PRO2
Operating System: Windows 11 Pro 64 Bit
Location: Camberley

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Post by Dennisdg »

Thanks - all sorted now.

Cheers
Dennis

https://g4glp.co.uk

Davis Vantage PRO2
Win 11 Pro 64 bit
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Post 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.
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Post 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.
Last edited by sfws on Fri 26 Jun 2020 3:46 pm, edited 2 times in total.
User avatar
mcrossley
Posts: 12756
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Post 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.
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Post 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.
Last edited by sfws on Fri 18 Mar 2022 6:12 pm, edited 2 times in total.
Dennisdg
Posts: 220
Joined: Tue 07 Feb 2012 9:42 am
Weather Station: Davis Vantage PRO2
Operating System: Windows 11 Pro 64 Bit
Location: Camberley

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Post 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.
Dennis

https://g4glp.co.uk

Davis Vantage PRO2
Win 11 Pro 64 bit
sfws
Posts: 1183
Joined: Fri 27 Jul 2012 11:29 am
Weather Station: Chas O, Maplin N96FY, N25FR
Operating System: rPi 3B+ with Buster (full)

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Post 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.
You do not have the required permissions to view the files attached to this post.
Dennisdg
Posts: 220
Joined: Tue 07 Feb 2012 9:42 am
Weather Station: Davis Vantage PRO2
Operating System: Windows 11 Pro 64 Bit
Location: Camberley

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Post 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.
Dennis

https://g4glp.co.uk

Davis Vantage PRO2
Win 11 Pro 64 bit
sutne
Posts: 377
Joined: Sun 14 Oct 2012 4:23 pm
Weather Station: HP2553 (WS80) and HP2564 (WS90)
Operating System: Raspbian Bullseye and Bookworm
Location: Rjoanddalen and Kronstad, Norway
Contact:

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Post by sutne »

Multilingual is working everywhere except for the pop-up graphs on the gauges.
Any plans for those?
sutne
Posts: 377
Joined: Sun 14 Oct 2012 4:23 pm
Weather Station: HP2553 (WS80) and HP2564 (WS90)
Operating System: Raspbian Bullseye and Bookworm
Location: Rjoanddalen and Kronstad, Norway
Contact:

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Post 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.
sutne
Posts: 377
Joined: Sun 14 Oct 2012 4:23 pm
Weather Station: HP2553 (WS80) and HP2564 (WS90)
Operating System: Raspbian Bullseye and Bookworm
Location: Rjoanddalen and Kronstad, Norway
Contact:

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Post 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.
Dennisdg
Posts: 220
Joined: Tue 07 Feb 2012 9:42 am
Weather Station: Davis Vantage PRO2
Operating System: Windows 11 Pro 64 Bit
Location: Camberley

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Post by Dennisdg »

Your pop-up graphs on the gauges look good to me.
Dennis

https://g4glp.co.uk

Davis Vantage PRO2
Win 11 Pro 64 bit
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Post by BCJKiwi »

@ sutne

Yes Will review the source file and advise.
sutne
Posts: 377
Joined: Sun 14 Oct 2012 4:23 pm
Weather Station: HP2553 (WS80) and HP2564 (WS90)
Operating System: Raspbian Bullseye and Bookworm
Location: Rjoanddalen and Kronstad, Norway
Contact:

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Post 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.
BCJKiwi
Posts: 1255
Joined: Mon 09 Jul 2012 8:40 pm
Weather Station: Davis VP2 Cabled
Operating System: Windows 10 Pro
Location: Auckland, New Zealand
Contact:

Re: CumulusMX and Cumulus1 UI style Multilingual Websites

Post by BCJKiwi »

@ sutne
When I view your site the gauges pop up graph legends are in the language selected.
Post Reply