Thank you Thomas, your instruction fixes the issue! My template was missing 
the #encoding UTF-8. I entered this row above the <!DOCTYPE HTML>.
(y)
Many thanks.


Check for an #encoding directive at the top of your template. For example, 
> index.html.tmpl in the Standard template uses:
>
> #errorCatcher Echo
> ##
> ## Specifying an encoding of UTF-8 is usually safe:
> #encoding UTF-8
> ##
> <!DOCTYPE HTML>
> <html lang="en">
>   <head>
>     ## This choice should match the #encoding directive above
>     <meta charset="UTF-8">
>
>
> -tk
>
> On Wed, Jul 31, 2019 at 2:27 AM peter <[email protected] <javascript:>> 
> wrote:
>
>> If I want to use special (non-English) characters like čžš, I get the 
>> following error:
>> Jul 31 08:21:16 weather weewx[22398]: cheetahgenerator: Generate failed 
>> with exception '<type 'exceptions.UnicodeDecodeError'>'
>> Jul 31 08:21:16 weather weewx[22398]: cheetahgenerator: **** Ignoring 
>> template /etc/weewx/skins/neowx/index.php.tmpl
>> Jul 31 08:21:16 weather weewx[22398]: cheetahgenerator: **** Reason: 
>> 'ascii' codec can't decode byte 0xc4 in position 10547: ordinal not in 
>> range(128)
>> Jul 31 08:21:16 weather weewx[22398]: ****  Traceback (most recent call 
>> last):
>> Jul 31 08:21:16 weather weewx[22398]: ****    File 
>> "/usr/share/weewx/weewx/cheetahgenerator.py", line 330, in generate
>> Jul 31 08:21:16 weather weewx[22398]: ****      filter=encoding,
>> Jul 31 08:21:16 weather weewx[22398]: ****    File 
>> "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1336, in 
>> __init__
>> Jul 31 08:21:16 weather weewx[22398]: ****      self._compile(source, 
>> file, compilerSettings=compilerSettings)
>> Jul 31 08:21:16 weather weewx[22398]: ****    File 
>> "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 1637, in 
>> _compile
>> Jul 31 08:21:16 weather weewx[22398]: ****     
>>  keepRefToGeneratedCode=True)
>> Jul 31 08:21:16 weather weewx[22398]: ****    File 
>> "/usr/lib/python2.7/dist-packages/Cheetah/Template.py", line 772, in compile
>> Jul 31 08:21:16 weather weewx[22398]: ****     
>>  settings=(compilerSettings or {}))
>> Jul 31 08:21:16 weather weewx[22398]: ****    File 
>> "/usr/lib/python2.7/dist-packages/Cheetah/Compiler.py", line 1708, in 
>> __init__
>> Jul 31 08:21:16 weather weewx[22398]: ****      source = unicode(source)
>> Jul 31 08:21:16 weather weewx[22398]: ****  UnicodeDecodeError: 'ascii' 
>> codec can't decode byte 0xc4 in position 10547: ordinal not in range(128)
>>
>> This only happens when I put these characters in the html/php template 
>> files. The weewx.conf or skin.conf use these characters for parameter 
>> definition and correctly include them into tags when the html file is being 
>> generated.
>>
>> I use standard weewx configuration, no modifications to engine.py etc. I 
>> checked and the utf-8 is defined in the html templates.
>>
>> I appreciate suggestions how to make this work.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "weewx-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/weewx-user/954066dc-08fe-4bf0-b3dc-08604ef25064%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/weewx-user/954066dc-08fe-4bf0-b3dc-08604ef25064%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/c14752e7-8401-45bd-9071-1501f5dc86fa%40googlegroups.com.

Reply via email to