From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Peter Brett Newsgroups: gmane.lisp.guile.devel Subject: Re: Using libunistring for string comparisons et al Date: Thu, 31 Mar 2011 15:59:50 +0100 Organization: University of Surrey, Guildford, England Message-ID: References: <336042.33326.qm@web37901.mail.mud.yahoo.com> <878vwgmhah.fsf@netris.org> <511668.33680.qm@web37902.mail.mud.yahoo.com> <87sjuokniq.fsf@netris.org> <118142.11911.qm@web37907.mail.mud.yahoo.com> <87ipvjlvgj.fsf@netris.org> <87mxkdbpcp.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1301583625 19070 80.91.229.12 (31 Mar 2011 15:00:25 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 31 Mar 2011 15:00:25 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Mar 31 17:00:21 2011 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.69) (envelope-from ) id 1Q5JMC-0001f7-L5 for guile-devel@m.gmane.org; Thu, 31 Mar 2011 17:00:20 +0200 Original-Received: from localhost ([127.0.0.1]:58209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5JMC-0008FH-3H for guile-devel@m.gmane.org; Thu, 31 Mar 2011 11:00:20 -0400 Original-Received: from [140.186.70.92] (port=38243 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q5JM4-0008Ex-CO for guile-devel@gnu.org; Thu, 31 Mar 2011 11:00:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q5JM3-0002Bn-13 for guile-devel@gnu.org; Thu, 31 Mar 2011 11:00:12 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:50613) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q5JM2-0002BP-QB for guile-devel@gnu.org; Thu, 31 Mar 2011 11:00:10 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q5JLv-0001Um-Q0 for guile-devel@gnu.org; Thu, 31 Mar 2011 17:00:03 +0200 Original-Received: from 131.227.8.61 ([131.227.8.61]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 Mar 2011 17:00:03 +0200 Original-Received: from peter by 131.227.8.61 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 31 Mar 2011 17:00:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 33 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 131.227.8.61 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:rAXibz7PlpVLesSLIkmoRyTwAA8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:12122 Archived-At: ludo@gnu.org (Ludovic Courtès) writes: > Hi Peter, > > Peter Brett writes: > >> It would certainly make my life as a downstream application maintainer >> much, much easier if all Guile API functions that accept a C string >> argument expected UTF-8. > > Out of curiosity, what kind of C libraries and tools do you use? > > My impression is that GLib & co. are well-equipped to deal with UTF-8 > whereas other C libraries and programs would rather work with locale > encoding or ‘wchar_t’ using the standard C APIs. > Yep, lots of GLib. Our file formats use UTF-8, and all of our non-Scheme code uses UTF-8. We are pretty careful about ensuring that our C code is UTF-8 safe (using GLib!), but spend a lot of time crossing our fingers and hoping that if we pass a string to Guile we'll get it back in the right encoding. Note that we have to support Guile 1.8.x as well, probably until at least 2013. Some tips on the safest way to do this would be great (but probably belong on guile-user or [even better] in the fine manual). Peter -- Peter Brett Remote Sensing Research Group Surrey Space Centre