caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Michael Ekstrand <michael@elehack.net>
To: Paul Steckler <steck@stecksoft.com>
Cc: "caml-list@yquem.inria.fr" <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Windows filenames and Unicode
Date: Wed, 29 Sep 2010 09:56:45 +0200	[thread overview]
Message-ID: <1285747005.5671.27.camel@knine> (raw)
In-Reply-To: <AANLkTimXMWGQ=_7vCbLo7yP_14pU4Ld8jqBA0iq9-69T@mail.gmail.com>

On Wed, 2010-09-29 at 17:26 +1000, Paul Steckler wrote:
> Hmmm, I shouldn't have to do this.  Are there plans afoot to modernize
> OCaml's string-handling?

The Batteries project aims to provide more modernized string handling,
and we already go a long way with the UTF8 module (from Camomile) and
ropes.  That does not, however, affect the file opening routines, as the
current Batteries design requires you to open files using platform
strings for their names.

It may be interesting to look at allowing files to be opened using
unicode names.  However, this is fraught with difficulties, particularly
in cross-platform situation.  Handling filenames in Unicode is incorrect
on Unix and Linux systems where the locale encoding does not have an
idempotent conversion to and from Unicode.  Therefore, the correct way
to handle filenames in a cross-platform fashion is to always store them
in the system filename encoding (any Unicode encoding on Windows when
the wide functions are supported, the current locale encoding on Unix)
and convert them to Unicode only for display.  IMO any enhanced string
design covering filenames must encourage this.  Fortunately, OCaml's
type system makes such an API fairly natural, it just needs to be
designed and implemented.

- Michael

-- 
Web/blog: http://elehack.net/michael
Jabber/Google Talk: this e-mail address
Twitter: http://twitter.com/elehack
mouse, n: a device for pointing at the xterm in which you want to type


  reply	other threads:[~2010-09-29  7:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-29  5:05 Paul Steckler
2010-09-29  6:23 ` [Caml-list] " David Allsopp
2010-09-29  7:26   ` Paul Steckler
2010-09-29  7:56     ` Michael Ekstrand [this message]
2010-09-29  7:58     ` David Allsopp
2010-09-29  8:14     ` Jerome Vouillon
2010-09-30 19:27     ` ygrek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1285747005.5671.27.camel@knine \
    --to=michael@elehack.net \
    --cc=caml-list@yquem.inria.fr \
    --cc=steck@stecksoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).