caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Dmitry Bely <dmitry.bely@gmail.com>
To: OCaml mailing list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Re: [ANN] Camomile 0.7.3
Date: Fri, 14 May 2010 12:35:45 +0400	[thread overview]
Message-ID: <AANLkTin7IACVaPx4cm6_KEfq9GvvMMRtZneEYMn92b0V@mail.gmail.com> (raw)
In-Reply-To: <AANLkTilG-4uKnxto9KYx_uFPjPx5D41CHxBtbxYXjTbt@mail.gmail.com>

How "heavy-weight" is Camomile? I was a bit scared with the size of
its distribution. Currently I use under Windows the following my own
simple Unicode-support module (implemented via
WideCharToMultiByte/MultiByteToWideChar Win32 API functions). Maybe
it's time to switch to Camomile?

(** Wide char/string operations. *)

type codePage =
    CP_ACP (* ANSI code page *)
  | CP_MACCP (* Macintosh code page *)
  | CP_OEMCP (* OEM code page *)
  | CP_SYMBOL (* Symbol code page (42) *)
  | CP_THREAD_ACP (* The current thread's ANSI code page *)
  | CP_UTF7 (* Translate using UTF-7 *)
  | CP_UTF8 (* Translate using UTF-8 *)
  | CP_NUMERIC of int

module Wchar:
sig
(*IF-OCAML*)
  type t = private int
(*ENDIF-OCAML*)
(*F#
  type t = char
F#*)

  val compare: t -> t -> int
  val of_int: int -> t
  val to_int: t -> int
  val encode: codePage -> t -> Bytes.bytes
  val decode: codePage -> Bytes.bytes -> t
end

module Wstring:
sig
(*IF-OCAML*)
  type t = private int array
(*ENDIF-OCAML*)
(*F#
  type t = string
F#*)

  val compare: t -> t -> int
  val length : t -> int
  val get: t -> int -> Wchar.t
  val make: int -> Wchar.t -> t
  val append: t -> t -> t
  val uppercase: t -> t
  val lowercase: t -> t

  val of_array: Wchar.t array -> t
  val to_array: t -> Wchar.t array
  val of_int_array: int array -> t
  val to_int_array: t -> int array
  val of_list: Wchar.t list -> t
  val to_list: t -> Wchar.t list

  val empty: t
(*IF-OCAML*)
  external pack_to_string: t -> string = "w32_unicode_pack_to_string"
    (** convert to packed 2-byte UCS2 string, stored as Caml string *)
  external unpack_from_string: string -> t = "w32_unicode_unpack_from_string"
    (** inverse function for pack_to_string *)
(*ENDIF-OCAML*)
  val encode: codePage -> t -> Bytes.bytes
  val decode: codePage -> Bytes.bytes -> t
end

type wchar = Wchar.t
type wstring = Wstring.t

(**/**)

- Dmitry Bely


  reply	other threads:[~2010-05-14  8:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTim0Q-Kd_1cyI_0VT91V_wkCBz2TvmLRDyevQq2H@mail.gmail.com>
2010-05-12 12:13 ` Yoriyuki Yamagata
2010-05-12 13:57   ` [Caml-list] " Romain Beauxis
2010-05-12 14:24   ` Romain Beauxis
2010-05-12 22:02   ` Sylvain Le Gall
2010-05-13  1:19     ` [Caml-list] " Yoriyuki Yamagata
2010-05-13  9:52       ` Sylvain Le Gall
2010-05-14  2:51         ` [Caml-list] " Yoriyuki Yamagata
2010-05-14  6:48           ` Paolo Donadeo
2010-05-14  8:35             ` Dmitry Bely [this message]
2010-05-14 13:30               ` Yoriyuki Yamagata
2010-05-14 13:55                 ` Sylvain Le Gall
2010-05-15 12:15                   ` Yoriyuki Yamagata
2010-05-14  8:14           ` Sylvain Le Gall
2010-05-14 11:35             ` [Caml-list] " Yoriyuki Yamagata
2010-05-14 19:04           ` Florent Monnier
2010-05-18 11:04       ` Yoriyuki Yamagata
2010-05-13 22:17   ` [Caml-list] " forum

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=AANLkTin7IACVaPx4cm6_KEfq9GvvMMRtZneEYMn92b0V@mail.gmail.com \
    --to=dmitry.bely@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    /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).