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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 1A9A2BC57 for ; Fri, 14 May 2010 10:35:47 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At8DAE6o7EtKfVK0gGdsb2JhbACdewgVAQEUJCKsOoIAhQguiE0BAQMFhQsEgzs X-IronPort-AV: E=Sophos;i="4.53,227,1272837600"; d="scan'208";a="62822452" Received: from mail-wy0-f180.google.com ([74.125.82.180]) by mail4-smtp-sop.national.inria.fr with ESMTP; 14 May 2010 10:35:47 +0200 Received: by wyb32 with SMTP id 32so1471798wyb.39 for ; Fri, 14 May 2010 01:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=SlIROCrrnkgN25RuAsnjTAp4cF4SwDS3aB2cNVE+q5Y=; b=mGgVl+77PliY/EDA33pB7t4luJHiOFjrMwUqHA7Rk0gq8c2d122j0rwN/WfHYG1hTw EOEe+POVnxjO9QAvWiaaZcCIY2+mnZq0HS0kvED+Q83urX72OqLgSE56ZZ8ozqYWNqiW TTcQ2Nh7tKB4C/nmjCWeljYq9izYZvn7OtGBI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=q6Q+eCzZJWwQLL4WFtYEbpiRnoI3ZhSo8Ucl1jrgM25D5CeixA3S846YAPEAvkcLm3 Ep1AwyRyTG/+c0ygs2UyecYJ2u+Va9AVYj42qPkjx7SohqNz36AotcI/Ykpkfh+CMhvA GsX6Il1eC7RS1CYPAYrwsTfvo0fl+IxDoOxTc= MIME-Version: 1.0 Received: by 10.227.141.132 with SMTP id m4mr915938wbu.166.1273826145801; Fri, 14 May 2010 01:35:45 -0700 (PDT) Received: by 10.216.85.204 with HTTP; Fri, 14 May 2010 01:35:45 -0700 (PDT) In-Reply-To: References: Date: Fri, 14 May 2010 12:35:45 +0400 Message-ID: Subject: Re: [Caml-list] Re: [ANN] Camomile 0.7.3 From: Dmitry Bely To: OCaml mailing list Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; camomile:01 camomile:01 sig:01 val:01 val:01 sig:01 lowercase:01 unpack:01 unpack:01 char:01 char:01 encode:01 encode:01 dmitry:01 dmitry:01 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