Re: [ANNOUNCE] Kconfiglib menuconfig implementation

From: Pavel Machek
Date: Mon May 14 2018 - 12:59:00 EST


Hi!

> > config CAN_PEAK_PCIEFD
> > depends on PCI
> > tristate "PEAK-System PCAN-PCIe FD cards"
> > ---help---
> > This driver adds support for the PEAK-System PCI Express FD
> > CAN-FD cards family.
> > These 1x or 2x CAN-FD channels cards offer CAN 2.0 a/b as well as
> > CAN-FD access to the CAN bus. Besides the nominal bitrate of up to
> > 1 Mbit/s, the data bytes of CAN-FD frames can be transmitted with
> > up to 12 Mbit/s. A galvanic isolation of the CAN ports protects the
> > electronics of the card and the respective computer against
> > disturbances of up to 500 Volts. The PCAN-PCI Express FD can be
> > operated with ambient temperatures in a range of -40 to +85 °C.
> >
> >
> > kconfiglib.KconfigSyntaxError:
> > Malformed ascii in drivers/net/can/peak_canfd/Kconfig
> > Context: b't temperatures in a range of -40 to +85 \xc2\xb0C.\n'
> > Problematic data: b'\xc2'
> > Reason: ordinal not in range(128)
> >
> >
> > thanks,
> > --
> > ~Randy
>
> Thanks for trying it out!
>
> You're probably running in the C locale, which implies an ASCII
> encoding. That has caused enough trouble that the Python devs decided
> to automatically convert it to UTF-8 in Python 3.7:
> https://www.python.org/dev/peps/pep-0538/. LC_CTYPE=C.UTF-8 should fix
> it.
>
> It's a bit silly to have it crash for something like that though. I
> could force UTF-8 instead of respecting the locale (though it feels
> neater to respect settings), or tell Python to ignore decoding errors.
> Should probably do something at least...

Well, Kconfig files are utf-8, as is the rest of kernel.

So yes, you should respect $LC_CTYPE for display etc, but you should always
assume Kconfig files are utf-8... and that does not need to be optional.

Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html