From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mike Gran Newsgroups: gmane.lisp.guile.devel Subject: scm_to_locale_stringbuf Date: Tue, 3 Feb 2009 08:25:48 -0800 (PST) Message-ID: <493834.3827.qm@web37902.mail.mud.yahoo.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1233678375 16985 80.91.229.12 (3 Feb 2009 16:26:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 Feb 2009 16:26:15 +0000 (UTC) To: guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Feb 03 17:27:30 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LUO7K-00043U-1I for guile-devel@m.gmane.org; Tue, 03 Feb 2009 17:27:18 +0100 Original-Received: from localhost ([127.0.0.1]:49884 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LUO61-00014M-6O for guile-devel@m.gmane.org; Tue, 03 Feb 2009 11:25:57 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LUO5v-00014D-Vc for guile-devel@gnu.org; Tue, 03 Feb 2009 11:25:51 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LUO5u-00013t-Cg for guile-devel@gnu.org; Tue, 03 Feb 2009 11:25:51 -0500 Original-Received: from [199.232.76.173] (port=36177 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LUO5u-00013q-68 for guile-devel@gnu.org; Tue, 03 Feb 2009 11:25:50 -0500 Original-Received: from web37902.mail.mud.yahoo.com ([209.191.91.164]:31923) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1LUO5t-0005O1-Qz for guile-devel@gnu.org; Tue, 03 Feb 2009 11:25:50 -0500 Original-Received: (qmail 3889 invoked by uid 60001); 3 Feb 2009 16:25:48 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=pCUKP6oUKsBjRdliuytiqp4d/CNwbeXr7FgIuHr58RY5AvD0GGgond6hzytDqNidHMZe+6DdgJ4eJBI35ZKM4HR10s94wOY4ZAVHZh5pow6K6PYyk2c1+UdLK7hQh8K+jw6Da9PooDMPFXY4KZo5HtMGnLVO3BnIIjjcEKoCKu0=; X-YMail-OSG: ltiUyCkVM1na0BHX.tvIssp92Qz5GI5SgOJsNIt9sEJaX6JeNt9S8ga_8mG.alldDiS4no_GWYcTBjOrskir8hMUleJubShyIUAONPwKYw_LiyyRzOPmY_tNwy6iTCRPvgdVMW4ONRKVbCZB1bpwanqi8jW8fZF4h_GxdlMcuZTd1bZlHr1WLu17Wk8- Original-Received: from [71.140.147.207] by web37902.mail.mud.yahoo.com via HTTP; Tue, 03 Feb 2009 08:25:48 PST X-Mailer: YahooMailRC/1156.82 YahooMailWebService/0.7.260.1 X-detected-operating-system: by monty-python.gnu.org: FreeBSD 6.x (1) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:8122 Archived-At: Hi, The description for scm_to_locale_stringbuf doesn't specify what happens when the final multibyte character doesn't fit in the provided string buffer. size_t scm_to_locale_stringbuf (SCM str, char *buf, size_t max_len) Say the locale is UTF-8, and the last position in BUF would be the first byte of a two-byte character. The right thing is not to copy that first byte of the character into the last position of BUF, but, instead copy a '\0'. But there is no way to indicate to the caller that the final '\0' is padding and not a true '\0'. Ideas? Thanks, Mike Gran