Pier sent his configuration file, weewx.conf to me.

As suspected, it includes a BOM ("byte order marker") at the beginning,
which signaled to the configuration parser that the file was encoded in
utf-8. So, when the parser read it, it automatically converted it to
Unicode.  Hence, when interpreting something like

config_dict['HTML_ROOT']


the results came back in unicode, instead of ascii.

Pier: most likely you used some text editor which put the BOM at the
beginning of the file.

To convert your weewx.conf to a version that is pure ascii, do this:

mv weewx.conf weewx.conf.utf8
iconv -f utf-8 -t ascii//TRANSLIT <weewx.conf.utf8 > weewx.conf


However, we really should protect against this within weewx. I've posted
issue #172 <https://github.com/weewx/weewx/issues/172> to deal with this.

-tk


On Sun, Oct 16, 2016 at 9:28 AM, Thomas Keffer <tkef...@gmail.com> wrote:

> Thanks, Pier.
>
> The Unicode seems to be coming from weewx.conf. In particular, HTML_ROOT,
> SKIN_ROOT, and skin all seem to be in unicode, which would suggest that
> they are encoded as utf-8 within your copy of weewx.conf.
>
> Could you please send weewx.conf to me privately? While you could edit it
> to remove any passwords, or run it through wee_debug, I'm concerned that
> may change the byte coding. Send it to 'tkef...@gmail.com'.
>
> You mentioned that you have been "doing some experiments with weewx
> 3.5.0." Does this mean you have been modifying the code base?
>
> -tk
>
>
>
> On Sun, Oct 16, 2016 at 8:55 AM, Pier Francesco Costa <
> piercost...@gmail.com> wrote:
>
>> @Glenn
>>
>> Thank you for your suggestion! I will look into that!
>>
>> @Tom
>>
>> I followed your instructions, but just running doesn't generate a
>> meaningful log, so i started the daemon again.
>>
>> Here's the log.
>>
>> --
>> 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 weewx-user+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to