From owner-freebsd-arch@FreeBSD.ORG Thu Jul 31 21:41:13 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 18E01B50; Thu, 31 Jul 2014 21:41:13 +0000 (UTC) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1lp0144.outbound.protection.outlook.com [207.46.163.144]) (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 EF3FD2AFF; Thu, 31 Jul 2014 21:41:11 +0000 (UTC) Received: from BLUPR05CA0076.namprd05.prod.outlook.com (10.141.20.46) by BY2PR05MB726.namprd05.prod.outlook.com (10.141.223.19) with Microsoft SMTP Server (TLS) id 15.0.995.14; Thu, 31 Jul 2014 21:41:02 +0000 Received: from BN1AFFO11FD045.protection.gbl (2a01:111:f400:7c10::144) by BLUPR05CA0076.outlook.office365.com (2a01:111:e400:855::46) with Microsoft SMTP Server (TLS) id 15.0.995.14 via Frontend Transport; Thu, 31 Jul 2014 21:41:01 +0000 Received: from P-EMF02-SAC.jnpr.net (66.129.239.16) by BN1AFFO11FD045.mail.protection.outlook.com (10.58.53.60) with Microsoft SMTP Server (TLS) id 15.0.990.10 via Frontend Transport; Thu, 31 Jul 2014 21:41:00 +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; Thu, 31 Jul 2014 14:40:58 -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 s6VLejn91464; Thu, 31 Jul 2014 14:40:56 -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 s6VLeTS4097915; Thu, 31 Jul 2014 17:40:32 -0400 (EDT) (envelope-from phil@idle.juniper.net) Message-ID: <201407312140.s6VLeTS4097915@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: <20140731210937.GV43962@funkthat.com> Date: Thu, 31 Jul 2014 17:40:29 -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)(6806004)(80022001)(44976005)(87936001)(81156004)(21056001)(95666004)(79102001)(47776003)(83322001)(76506005)(85306003)(20776003)(76482001)(4396001)(105596002)(77982001)(74502001)(107046002)(102836001)(97736001)(53416004)(103666002)(110136001)(81342001)(92566001)(54356999)(106466001)(85852003)(69596002)(31966008)(48376002)(81542001)(50466002)(50986999)(92726001)(68736004)(86362001)(99396002)(46102001)(83072002)(84676001); DIR:OUT; SFP:; SCL:1; SRVR:BY2PR05MB726; 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: 0289B6431E 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: Thu, 31 Jul 2014 21:41:13 -0000 John-Mark Gurney writes: >Well, from my understanding there can't be a "locale" that is UTF-8 >as a locale contains more than just character encoding... It also >includes month/day names, sorting, etc... I think you can get a >C locale (the default) w/ UTF-8 by setting the correct environment >variables, but I don't know them well enough to say... Should we add >a locale that does this? There is UTF-8 in /usr/share/locale, but if >you set LANG to it, things don't work.. I'll change the library to follow the settings of the user's env var and assuming they've set it correctly, all will work well. Since libxo uses vsnprintf under the covers, all this should work fine. (void)wcsftime(buf, sizeof(buf), fmt, &tp); ... xo_emit("{:login-time/%ls}", buf); Or something like that...... Thanks, Phil