Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Jul 2014 19:24:11 -0400
From:      Phil Shafer <phil@juniper.net>
To:        John-Mark Gurney <jmg@funkthat.com>
Cc:        sjg@freebsd.org, arch@freebsd.org, marcel@freebsd.org
Subject:   Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML
Message-ID:  <201407302324.s6UNOB2H087915@idle.juniper.net>
In-Reply-To: <20140730193819.GM43962@funkthat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
John-Mark Gurney writes:
>My vote would be to use and *enforce* UTF-8 by the API.   That means if
>someone passes a string in, it must be properly formed UTF-8...

I can certainly see making this an option, detecting the high-bit
and inspecting the following 1-5 bytes to ensure the corresponding
high two bits are set appropriately.  But what action would you
expect the library to take when invalid strings are passed in?
libxo supports a warning flag, that will trigger warnings on stderr
for things like invalid or malformed format strings, but I'm not
sure I'd be happy if the library skipped invalid strings.

BTW, this issue is driven by "w"s use of wide characters (for
days of the week).

Thanks,
 Phil



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407302324.s6UNOB2H087915>