Re: [weewx-user] Re: formatting issue in cheetah

2023-08-27 Thread Tom Keffer
I tried your test template (on my Mac) and it worked perfectly using both HTML entities and UTF-8 encodings. The results are attached. I'm grasping here, but it must have something to do with your environment. What do you get for *echo $LANG* *python3 -c "import locale;print(locale.setlocale(loc

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-27 Thread vince
Fascinating. I came up with a modified test template that prints out the units for everything in the extended schema, but my little one is sufficient to show the issue. For me if encoding=html_entities then labels using group_concentration are garbled, but temperatures and radiation units and

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-27 Thread jterr...@gmail.com
here is the result of your test.index.html in my system : http://meteo-sciez.fr/weewx/tagssciez/test.html the pmxxx units are correctly shown, but not the outTemp and radiation units ! Le dimanche 27 août 2023 à 17:23:40 UTC+2, vince a écrit : > I guess if anybody else could try the test.ind

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-27 Thread vince
I guess if anybody else could try the test.index.html file I previously posted in https://groups.google.com/g/weewx-user/c/nW3U8DVMZyU/m/qSosva-hAAAJ on their systems it might help, if you have time to do so of course. If you get it working somehow, let us know and if there's a URL to let othe

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-27 Thread jterr...@gmail.com
hex C2 B5 is the UTF-8 binary encoding of "micro" in a "text" file such as a python script. But as far as HTML is concerned, the html UTF-8 encoding of "micro" is either µ or µ or µ - see https://www.w3schools.com/charsets/tryit.asp?deci=181&ent=micro May be cheetah converts the two binary U

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-27 Thread Tom Keffer
I must admit to being a little lost. I wrote an article *Character encodings * to explain how encodings work within WeeWX. Maybe you'll recognize something? On Sat, Aug 26, 2023 at 12:10 PM vince wrote: > In deb12 dpkg of weewx 4 in a x86

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-26 Thread vince
In deb12 dpkg of weewx 4 in a x86_64 vm all the pm labels are still garbled using my test file even when run out of the Seasons skin. What is interesting is that 'without' adding the elements to extensions.py it somehow knows that the label is micrograms per cubic meter, it just doesn't know ho

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-26 Thread vince
I had not changed defaults.py but I 'had' neglected to add to extensions.py, which didn't help unfortunately. All the labels in my skin for concentrations that refer to elements from the secondary purpleair.sdb are garbled even when added to extensions.py but if I check some single character la

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-26 Thread Tom Keffer
After I put the following in user.extensions, your little test template worked for me, using both html entities, and utf-8 encoding. *import weewx.unitsweewx.units.obs_group_dict['pm2_5_cf_1'] = 'group_concentration'* I assume you did the same? The label for the unit microgram_per_meter_cubed

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-25 Thread vince
Doh - delete that last < in the line above before the body of course... On Friday, August 25, 2023 at 8:04:46 PM UTC-7 vince wrote: > Did not help. Is it possible there is something in the nginx > configuration 'or' the combination of python3/cheetah in the venv that > might be at fault ? I'

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-25 Thread vince
Did not help. Is it possible there is something in the nginx configuration 'or' the combination of python3/cheetah in the venv that might be at fault ? I'm running a v5 beta pip install FWIW. Here's the simplest example I can cook up. Simply try to show the units for something in group_concen

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-25 Thread Tom Keffer
Your little test page is still being interpreted by Chrome as being encoded in "windows-1252". Try including a meta tag for the encoding: test page On Fri, Aug 25, 2023 at 6:08 PM vince wrote: > No joy. > > Try "test.html" now for a far simpler variant. > It'll take a few minutes

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-25 Thread vince
No joy. Try "test.html" now for a far simpler variant. It'll take a few minutes for the rsync to update the public version. Here's the page source. test page AQI (current) 80.5

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-25 Thread Tom Keffer
The problem is the 'xmlns' declaration in your tag. It is causing metadata to be pulled in, which says that the character set is "windows-1252". Change this *http://www.w3.org/1999/xhtml "> http://www.w3.org/2005/10/profile ">*

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-25 Thread Greg from Oz
I am in Australia and https://www.skahan.net/weewx/purpleair.html works. So the Australian geo block is working OK. [image: Screenshot from 2023-08-26 09-25-36.png] On Saturday, 26 August 2023 at 09:10:00 UTC+10 Tom Keffer wrote: > Both the template and the skin configuration look fine. > > Desp

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-25 Thread Tom Keffer
Both the template and the skin configuration look fine. Despite being just down the road from you, I am unable to connect to your webserver. On Thu, Aug 24, 2023 at 5:15 PM vince wrote: > URL that rsync uploads to is https://www.skahan.net/weewx/purpleair.html > - this will not be available u

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-24 Thread vince
URL that rsync uploads to is https://www.skahan.net/weewx/purpleair.html - this will not be available unless you're in US/CA/AU probably due to some geoip blocking that I have set up on the ISP side to try to limit how many bots bang on the site. Same thing happens on chrome on mac os and iphon

Re: [weewx-user] Re: formatting issue in cheetah

2023-08-24 Thread Tom Keffer
Internal to WeeWX, the label microgram_per_meter_cubed is encoded in Unicode. To be included in a template, it has to be converted to an appropriate byte string using an encoding. By default, the Seasons templates use html entities to do this encoding. The results will be in simple ASCII. Note: th

[weewx-user] Re: formatting issue in cheetah

2023-08-24 Thread vince
Thanks. No joy. Added to top of the file under the echo line ala... ## Copyright 2009-2018 Tom Keffer, Matthew Wall ## Distributed under terms of GPLv3. See LICENSE.txt for your rights. #errorCatcher Echo #encoding UTF-8 #set $periods = $to_list($DisplayOptions.get('periods', ['day', 'week',

[weewx-user] Re: formatting issue in cheetah

2023-08-24 Thread gjr80
I notice the Seasons index.html.tmpl does not have a #encoding directive (though the other Seasons .html.tmpl files do). Have you tried adding a #encoding directive à la: #errorCatcher Echo #encoding UTF-8 Gary On Friday, 25 August 2023 at 07:19:12 UTC+10 vince wrote: > Well I can't explain

[weewx-user] Re: formatting issue in cheetah

2023-08-24 Thread vince
Well I can't explain it at all. I appended the same .tmpl line at the bottom of index.html.tmpl for the Seasons skin (trusting Tom gets this stuff correctly) and I still see funny encoding in Safari + Chrome (mac) and in Chrome (iphone). I can only guess it has something to do with the local

[weewx-user] Re: formatting issue in cheetah

2023-08-24 Thread Karen K
Unfortunately the greek my character and the cubic symbol are not US-ASCII. So they have the 8th bit set. There are different methods to do that. The older one is ISO 8859, where one byte is always one character. The newer one is UTF-8 where one character can be 1, 2 or even more bytes. So if yo

[weewx-user] Re: formatting issue in cheetah

2023-08-24 Thread vince
I have absolutely no idea what you just said. Sorry - US ASCII person here :-) View source shows AQI: 56(14.6 µg/m³) and https://www.w3schools.com/charsets/ref_html_8859.asp matches up (circumflex accent and micro symbol) but I have no idea what to do about it. -- You received this m

[weewx-user] Re: formatting issue in cheetah

2023-08-24 Thread Karen K
I guess that there is an issue with the character set ISO8859-1 vs. UTF-8. May be, #encoding is missing at the beginning of the Cheetah template file or does not match the real encoding of the file. Or the template is saved in ISO8859 character set instead of UTF-8. vince schrieb am Donnerstag,