From owner-freebsd-arch@FreeBSD.ORG Wed Jul 30 23:24:59 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04CF4981; Wed, 30 Jul 2014 23:24:59 +0000 (UTC) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2lp0235.outbound.protection.outlook.com [207.46.163.235]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "MSIT Machine Auth CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 723DB24B8; Wed, 30 Jul 2014 23:24:56 +0000 (UTC) Received: from BY2PR05CA062.namprd05.prod.outlook.com (10.141.250.52) by CO2PR05MB732.namprd05.prod.outlook.com (10.141.228.22) with Microsoft SMTP Server (TLS) id 15.0.995.14; Wed, 30 Jul 2014 23:24:55 +0000 Received: from BY2FFO11FD024.protection.gbl (2a01:111:f400:7c0c::162) by BY2PR05CA062.outlook.office365.com (2a01:111:e400:2c5f::52) with Microsoft SMTP Server (TLS) id 15.0.995.14 via Frontend Transport; Wed, 30 Jul 2014 23:24:54 +0000 Received: from P-EMF02-SAC.jnpr.net (66.129.239.16) by BY2FFO11FD024.mail.protection.outlook.com (10.1.15.213) with Microsoft SMTP Server (TLS) id 15.0.990.10 via Frontend Transport; Wed, 30 Jul 2014 23:24:54 +0000 Received: from magenta.juniper.net (172.17.27.123) by P-EMF02-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.146.0; Wed, 30 Jul 2014 16:24:53 -0700 Received: from idle.juniper.net (idleski.juniper.net [172.25.4.26]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id s6UNOpn65386; Wed, 30 Jul 2014 16:24:52 -0700 (PDT) (envelope-from phil@juniper.net) Received: from idle.juniper.net (localhost [127.0.0.1]) by idle.juniper.net (8.14.4/8.14.3) with ESMTP id s6UNOB2H087915; Wed, 30 Jul 2014 19:24:30 -0400 (EDT) (envelope-from phil@idle.juniper.net) Message-ID: <201407302324.s6UNOB2H087915@idle.juniper.net> To: John-Mark Gurney Subject: Re: XML Output: libxo - provide single API to output TXT, XML, JSON and HTML In-Reply-To: <20140730193819.GM43962@funkthat.com> Date: Wed, 30 Jul 2014 19:24:11 -0400 From: Phil Shafer MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.16; CTRY:US; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(189002)(164054003)(199002)(106466001)(76506005)(81156004)(76482001)(110136001)(105596002)(77982001)(46102001)(95666004)(6806004)(85306003)(50466002)(50986999)(79102001)(4396001)(81542001)(83322001)(68736004)(81342001)(53416004)(69596002)(31966008)(86362001)(47776003)(48376002)(92726001)(44976005)(99396002)(84676001)(54356999)(97736001)(20776003)(87936001)(103666002)(102836001)(107046002)(83072002)(80022001)(74662001)(21056001)(85852003)(64706001)(92566001)(74502001); DIR:OUT; SFP:; SCL:1; SRVR:CO2PR05MB732; H:P-EMF02-SAC.jnpr.net; FPR:; MLV:sfv; PTR:InfoDomainNonexistent; MX:1; LANG:en; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 0288CD37D9 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.16 as permitted sender) Authentication-Results: spf=softfail (sender IP is 66.129.239.16) smtp.mailfrom=phil@juniper.net; X-OriginatorOrg: juniper.net Cc: sjg@freebsd.org, arch@freebsd.org, marcel@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Jul 2014 23:24:59 -0000 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