From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 4F926BBAF; Thu, 3 Jun 2010 15:27:51 +0200 (CEST) X-IronPort-AV: E=Sophos;i="4.53,354,1272837600"; d="scan'208,217";a="60558005" Received: from alcazar.inria.fr ([128.93.24.50]) by mail1-relais-roc.national.inria.fr with ESMTP; 03 Jun 2010 15:27:51 +0200 Date: Thu, 3 Jun 2010 15:27:51 +0200 From: Maxence Guesdon To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Ocamldoc and Unicode characters Message-ID: <20100603152751.461d2343@alcazar.inria.fr> In-Reply-To: <4C07A86A.70101@lri.fr> References: <4C07A86A.70101@lri.fr> Organization: INRIA X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; maxence:01 guesdon:01 maxence:01 guesdon:01 ocamldoc:01 lri:01 ocamldoc:01 beginner's:01 ocaml:01 bug:01 odoc:01 odoc:01 rocquencourt:01 beginners:01 wrote:01 On Thu, 03 Jun 2010 15:04:42 +0200 Romain Bardou wrote: > Hello, >=20 > If I put some unicode characters inside an ocamldoc comment, it is=20 > copied as is, but the browser does not print them correctly because the=20 > page header does not say that the page is encoded using unicode. >=20 > Is there a way I can change the header of the generated pages=20 > automatically to change the encoding information? >=20 > Thanks, >=20 > --=20 > Romain Bardou >=20 > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs I see two easy solutions: 1. Something like sed 's:iso-8859-1:UTF-8:' on each ocamldoc-generated html file 2. or create and use your own ocamldoc-generator as explained here: http://caml.inria.fr/pub/docs/manual-ocaml/manual029.html#toc112 In this generator, just set the character_encoding field something else than the default which is "\n" Somehting like the following code should to the trick: class my_doc_gen =3D object initializer character_encoding <- "\n" end let my_generator =3D new my_doc_gen let _ =3D Odoc_args.set_doc_generator (my_generator :> Odoc_args.doc_genera= tor) (code not tested) Hope this helps, --=20 Maxence Guesdon http://yquem.inria.fr/~guesdon/ Service Exp=E9rimentation et D=E9veloppements https://sed-roc.inria= .fr/ INRIA Paris-Rocquencourt http://www.inria.fr/rocquencourt/