caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jerome Vouillon <Jerome.Vouillon@pps.jussieu.fr>
To: Paul Steckler <steck@stecksoft.com>
Cc: David Allsopp <dra-news@metastack.com>,
	"caml-list@yquem.inria.fr" <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Windows filenames and Unicode
Date: Wed, 29 Sep 2010 10:14:47 +0200	[thread overview]
Message-ID: <20100929081447.GA10841@pps.jussieu.fr> (raw)
In-Reply-To: <AANLkTimXMWGQ=_7vCbLo7yP_14pU4Ld8jqBA0iq9-69T@mail.gmail.com>

On Wed, Sep 29, 2010 at 05:26:52PM +1000, Paul Steckler wrote:
[...]
> For Linux, I was planning on enforcing the invariant that all
> strings inside my program are UTF-8.  For Windows, I could use the
> same invariant, and modify the OCaml runtime so that all calls to
> Windows file primitives have those strings translated to UTF-16 (and
> return values translated back to UTF-8).  That is, I'd have to build
> a custom version of OCaml and wrap CreateFile, etc. with such
> Unicode translation functions.

The Unison file synchronizer (http://www.cis.upenn.edu/~bcpierce/unison/)
has binding for the UTF-16 Windows API.  You should have a look at it.
At the moment, this is fairly tied to Unison (in particular because we
want to still be able to access the 8bit API for compatibility with
previous versions of Unison), but it would be great to turn the code
into a standalone library.  One possibility would be to write a
Unicode version of the Unix library.

> All this is made slightly more complicated by the fact that I'm using
> the MinGW version of OCaml.

There is no difficulty accessing the UTF-16 Windows API with MinGW
version of OCaml.  Actually, I'm even crosscompiling from Linux
without any difficulty.

-- Jerome


  parent reply	other threads:[~2010-09-29  8:15 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
2010-09-29  7:58     ` David Allsopp
2010-09-29  8:14     ` Jerome Vouillon [this message]
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=20100929081447.GA10841@pps.jussieu.fr \
    --to=jerome.vouillon@pps.jussieu.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=dra-news@metastack.com \
    --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).