From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 00F1F7ED5C for ; Mon, 30 Jul 2012 13:31:06 +0200 (CEST) Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=212.227.126.187; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail4-smtp-sop.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=212.227.126.187; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail4-smtp-sop.national.inria.fr: domain of postmaster@moutng.kundenserver.de designates 212.227.126.187 as permitted sender) identity=helo; client-ip=212.227.126.187; receiver=mail4-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@moutng.kundenserver.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlkCAPJuFlDU4367k2dsb2JhbABFqEORFCIBAQEBCQkLCRQDJIIgAQEEATo0CyMdXQkSGQkJh2wDBgoHsDADiVgUizwFg0GDHAONQokbkVo X-IronPort-AV: E=Sophos;i="4.77,679,1336341600"; d="scan'208";a="152009941" Received: from moutng.kundenserver.de ([212.227.126.187]) by mail4-smtp-sop.national.inria.fr with ESMTP; 30 Jul 2012 13:31:06 +0200 Received: from office1.lan.sumadev.de (dslb-094-219-210-200.pools.arcor-ip.net [94.219.210.200]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MYtGN-1THPlT3Hwx-00VEZm; Mon, 30 Jul 2012 13:31:05 +0200 Received: from samsung (ip-92-50-84-130.unitymediagroup.de [92.50.84.130]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id 412E5C00D0; Mon, 30 Jul 2012 13:31:04 +0200 (CEST) Date: Mon, 30 Jul 2012 13:31:03 +0200 From: Gerd Stolpmann Reply-To: Gerd Stolpmann To: micha-1@fantasymail.de Cc: caml-list@inria.fr In-Reply-To: <50164186.40401@fantasymail.de> X-Mailer: Balsa 2.4.11 Message-Id: <1343647863.760.0@samsung> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-Provags-ID: V02:K0:Tm6xUxFrcuEu8OAzqu4RLRVCh4UKNMk/RJJhqZe84Wm JzJRapmoJYXSOtY2ZLgf1eFjQIrvdCdvYO7Ip4qS9nmYxscbb6 3ajx0PvJux3aiDrXO6LMPpeDB2mQM2fEIIpqL3Mqt62wnJhyRj 6StlGMDqjKlUTbslb9HL+Uywi4O3XIXNhAAvUW67bz88WsyGhG idDXNEJzb3BOGI355ROS1lF3Gcz1KYsbj1AbpT+A6j7u9aJV1f aS5nWuchRLg2nTjlomt1s/7m4JLeJdva3SwZsYeo0PIBcLA6Hs 5WKVcs2tGvbmCsMa0nw9Vx+aXZTZ01pg6wGago2ZZ9pQX5BMhD c7bxeBTIrBrOyluHCtFA= Subject: AW: [Caml-list] utf-16 string operations Am 30.07.2012 10:10:46 schrieb(en) Michael: >=20 > What is the prefered way of doing string operations with utf-16=20=20 > strings? > Say, I have a utf-16 coded string and want to do some search/replace > operations on it. What is an easy way of doing this? >=20 > Does batteries include functions for doing this? Allthough reading > through the docs I don't see it. Search/replace is a bit unspecfic. But normally, it is best to convert=20= =20 to UTF-8, and do the operations then. UTF-8 has the advantage that it=20=20 is compatible to many algorithms working byte by byte, i.e. normal=20=20 string operations like substituting a given string by another one, or=20=20 comparing strings. Conversion support is available e.g. in Camomile, but also in Ocamlnet.=20= =20 Camomile has also some direct support for manipulating UTF-16 strings=20=20 encoded as int array (if you need to go down that far). pcre-ocaml supports regular expressions for UTF-8 strings. Gerd >=20 > thanks for answering > Michael >=20 >=20 > -- > Caml-list mailing list. Subscription management and archives: > https://sympa-roc.inria.fr/wws/info/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >=20 >=20 >=20 --=20 ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------=