From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 48656BC57 for ; Tue, 19 Oct 2010 17:19:59 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EADpUvUyty1O7/2dsb2JhbACTPY4qccARhUoEhFWIeg X-IronPort-AV: E=Sophos;i="4.57,350,1283724000"; d="scan'208";a="61815263" Received: from elehack.net ([173.203.83.187]) by mail3-smtp-sop.national.inria.fr with ESMTP; 19 Oct 2010 17:19:58 +0200 Received: from [128.101.33.159] (cs-wlc-159.cs.umn.edu [128.101.33.159]) by elehack.net (Postfix) with ESMTPSA id CB70BC8669; Tue, 19 Oct 2010 10:22:07 -0500 (CDT) Message-ID: <4CBDB719.8060804@elehack.net> Date: Tue, 19 Oct 2010 10:19:53 -0500 From: Michael Ekstrand User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100922 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: caml-list@yquem.inria.fr, Batteries Development Subject: Re: [Caml-list] Re: Unicode, update References: In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; implements:01 lablgtk:01 lablgtk:01 steckler:01 steck:01 steck:01 le-gall:01 le-gall:01 pervasives:01 getcwd:01 chdir:01 readdir:01 beginner's:01 ocaml:01 bug:01 On 10/19/2010 09:33 AM, Ashish Agarwal wrote: > Have you considered adding these to the Batteries project? It would be > good to get general purpose functionality added directly there. Also > that way you don't have to feel you've done a lot of things; a single > useful function could be added. I think there is promise in adding such functionality to Batteries' BatFile module, particularly if we adopt a design similar to that of Glib's filename support: * An abstract (or private) type 'filename': on Win32, this is a UTF-8 or UCS-2 Unicode string; on Unix, it is a string in the locale encoding (which is the best you can do, unfortunately). * Functions to convert to UTF-8 and the current locale for printing and display. * Idempotent conversion to/from UTF-8 for portable storage. Glib implements this with file:/// URLs, so that the non-ASCII characters can be URL-encoded and thus preserved. * Conversion from UTF-8 to handle user input, with the caveat that converting to UTF-8 and back will not necessarily result in the same filename. There might be types and definitions in lablgtk2 that we could try to be compatible with (particularly so you can use the results of a lablgtk2 file chooser as a filename to open). OTOH, Qt seems to get along using Unicode strings for filenames, so the encoding issues might not be that big a deal in practice. The easy path of just adding UTF-8 file open functions to BatFile (taking BatUTF8.t) might be OK. - Michael > On Mon, Oct 18, 2010 at 9:59 PM, Paul Steckler > wrote: > > Sylvain Le Gall > > wrote: > > Would it be possible to publish them as an external library? > > What I did isn't really complete enough to constitute a library, I'd > say. > > Here's what I did: > > >From Pervasives: > > open_out_win32 > open_out_bin_win32 > open_out_gen_win32 > open_in_win32 > open_in_bin_win32 > open_in_gen_win32 > > >From Sys: > > file_exists_win32 > getcwd_win32 > chdir_win32 > missing: is_directory_win32, readdir_win32 > > I did not code up Win32/UTF8 equivalents of anything in the Unix > module. A complete > library of Win32/UTF8 file functions would include a number of items > from that module. > > If anyone's interested in finishing off what I've done, I could send > along > what I have. > > -- Paul > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > > > > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs