[Nut-upsdev] gcc4 compiler warnings

Charles Lepple clepple at gmail.com
Fri Feb 10 13:31:50 UTC 2006


On 2/10/06, Arjen de Korte <nut+devel at de-korte.org> wrote:
[...]
> > Speaking of which, are there any cases where UTF-8 would cause
> > problems? In most cases where string comparisons are being used, the
> > UPS should be sending 7-bit values, so this may not be an issue.
>
> Indeed, it probably wouldn't be much an issue. String operations have no
> notion of UTF-8 and are only guaranteed to work on ASCII characters
> (0x00-0x7F) anyway.

Ah, I didn't notice that strcmp compares characters, while strcoll
(which isn't used in NUT) takes the locale into consideration.

> So if your UPS speaks UTF-8, you'd better leave the
> string functions out, or you may be in for some real unpleasant surprizes
> sooner or later.

I was worried more that an UPS which sends bytes > 128 would have
those bytes misinterpreted as part of a UTF-8 string, given a certain
locale configuration. Never mind.

--
- Charles Lepple



More information about the Nut-upsdev mailing list