From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6125 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Is c16rtomb a buggy/underspecified API, or is it just me? Date: Sun, 7 Sep 2014 12:24:43 -0400 Message-ID: <20140907162443.GA20128@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1410107102 5646 80.91.229.3 (7 Sep 2014 16:25:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 7 Sep 2014 16:25:02 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6138-gllmg-musl=m.gmane.org@lists.openwall.com Sun Sep 07 18:24:57 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XQfGq-0006We-AI for gllmg-musl@plane.gmane.org; Sun, 07 Sep 2014 18:24:56 +0200 Original-Received: (qmail 18061 invoked by uid 550); 7 Sep 2014 16:24:55 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 18053 invoked from network); 7 Sep 2014 16:24:55 -0000 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:6125 Archived-At: I was looking at how much work would be involved in adding uchar.h functions (one of the few remaining C11 items), and I can't seem to figure out how c16rtomb is supposed to work. It's presumably for converting UTF-16 to the locale's multibyte encoding (UTF-8 in our case), since the opposite-direction function (mbrtoc16) has provisions for generating pairs of surrogates, but I can't see any provisions in the specification of c16rtomb for what it does when it gets the first of a pair of surrogates and thus isn't ready to produce any output. http://port70.net/~nsz/c/c11/n1570.html#7.28.1.2 Any ideas? Rich