caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jake Donham <jake@donham.org>
To: Edgar Friendly <thelema314@gmail.com>
Cc: Dario Teixeira <darioteixeira@yahoo.com>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Storing UTF-8 in plain strings
Date: Wed, 12 Aug 2009 14:33:56 -0700	[thread overview]
Message-ID: <c7e4e9f0908121433i66cf1670m519056034c4b928b@mail.gmail.com> (raw)
In-Reply-To: <4A832B4C.903@gmail.com>

On Wed, Aug 12, 2009 at 1:51 PM, Edgar Friendly<thelema314@gmail.com> wrote:
>> - If the source is invalid UTF-8 in any way, Ulex will raise Utf8.MalFormed.
>>   I can therefore assume in subsequent steps that the source is compliant.
>>
> This is the weakest assumption of the four - Ulex could parse and only
> raise MalFormed on some errors.  I'm no expert on Ulex, though...

The original poster might be interested in the Netconversion module
from Ocamlnet, which is designed to work with UTF-8 stored in OCaml
strings. In particular it has a function

  Netconversion.verify `Enc_utf8 s

which checks that s is a valid UTF-8 string. It also has equivalents
for String.{get,sub,length}.

Jake


  reply	other threads:[~2009-08-12 21:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-12 17:36 Dario Teixeira
2009-08-12 18:24 ` Michael Ekstrand
2009-08-12 20:51 ` [Caml-list] " Edgar Friendly
2009-08-12 21:33   ` Jake Donham [this message]
2009-08-13  6:10 ` Florian Hars
2009-08-13  9:37 ` Dario Teixeira
2009-08-13 13:14   ` Dario Teixeira
2009-08-13 11:00 ` Richard Jones

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=c7e4e9f0908121433i66cf1670m519056034c4b928b@mail.gmail.com \
    --to=jake@donham.org \
    --cc=caml-list@yquem.inria.fr \
    --cc=darioteixeira@yahoo.com \
    --cc=thelema314@gmail.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).