[weewx-user] Re: Some strange formats in NOAA reports

2019-03-12 Thread Andrew Milner
These templates may get you started On Tuesday, 12 March 2019 21:39:49 UTC+2, Copain wrote: > > Many thanks, Thomas, appreciate your help. > > As I mentioned before, fortunately March is the only 'special' month in > German language … > > Maybe I will follow your and Adrew's advice to update to

[weewx-user] Re: Some strange formats in NOAA reports

2019-03-12 Thread Copain
Many thanks, Thomas, appreciate your help. As I mentioned before, fortunately March is the only 'special' month in German language … Maybe I will follow your and Adrew's advice to update to html NOAA. But as I am new to html programming, this certainly is still some time down the road. Or, do

Re: [weewx-user] Re: Some strange formats in NOAA reports

2019-03-12 Thread Thomas Keffer
Sorry. The test should be run as a Python program. You only get "Mr" instead of "Mär" for the same reason you don't get a degree sign: the character "ä" cannot be expressed in ASCII. So, it is ignored. If you really want the character in there, then the document must be encoded in UTF-8, not ASCI

[weewx-user] Re: Some strange formats in NOAA reports

2019-03-12 Thread Copain
Thanks, Thomas, but unfortunately you got me on the wrong foot … where exactly would I have to test these commands? Maybe in a weewx report? I presume, in my de_CH.utf-8 locale, the result would also be the same. That would match the attached NOAA text report, created with 'utf8' setting in ski

Re: [weewx-user] Re: Some strange formats in NOAA reports

2019-03-12 Thread Thomas Keffer
Try this: import locale, time locale.setlocale(locale.LC_ALL,'') print(time.strftime("%b")) print(time.strftime("%B")) Under German locale (LANG=de_DE.utf-8), I get Mär März -tk On Tue, Mar 12, 2019 at 9:13 AM Copain wrote: > Thanks, Thomas for your format details. > > I will do some more tes

[weewx-user] Re: Some strange formats in NOAA reports

2019-03-12 Thread Copain
Thanks, Thomas for your format details. I will do some more testing. Maybe I can find out, why month 'Mar' suddenly looses its middle 'a'. Certainly, there is also the influence from the locale. Fortunately, March is the ony month affected in German. Am Montag, 11. März 2019 17:15:21 UTC+1 s

Re: [weewx-user] Re: Some strange formats in NOAA reports

2019-03-12 Thread Thomas Keffer
The month name is from Python's strftime . Right now, the code it uses is %b --- Month name, abbreviated. If you want to change it, go into NOAA--MM.txt.tmpl and change the line MONTHLY CLIMATOLOGICAL SUMMARY for $mo

[weewx-user] Re: Some strange formats in NOAA reports

2019-03-12 Thread Andrew Milner
….. or you could change the NOAA templates to create prettier html files instead of plain txt files see http://weather.andrewmilner.online/NOAA/NOAA-2019-03.html as an example On Tuesday, 12 March 2019 15:22:24 UTC+2, Copain wrote: > > Understood. > > If set to 'strict_ascii', the 'degree chara

[weewx-user] Re: Some strange formats in NOAA reports

2019-03-12 Thread Copain
Understood. If set to 'strict_ascii', the 'degree character' will not be shown any more. But why month 'Mar' shows as 'Mr' only, loosing its middle character 'a'? This should not drop out. Might there still be some influence from the definition of the variables within weewx? Where are these la

Re: [weewx-user] Re: Some strange formats in NOAA reports

2019-03-12 Thread Thomas Keffer
If the encoding is set to utf-8, then the NOAA files will contain utf-8 characters. When a browser reads a file, it has to be told what encoding it uses. For HTML pages, this is done by a meta header: But, the NOAA files are not HTML files, they are just simple text files. So, the browser h

[weewx-user] Re: Some strange formats in NOAA reports

2019-03-12 Thread Copain
Thomas, many thanks, appreciate your support. I am running latest weewx 3.9.1 with latest niculskin. Indeed, formatting is set to 'utf8', which I changed to 'strict_ascii' for testing. However, now - temperature does not show 'degree character' any more ('C' only) and - month 'Mar' appears as 'M