caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Ocamldoc and Unicode characters
@ 2010-06-03 13:04 Romain Bardou
  2010-06-03 13:20 ` [Caml-list] " Daniel Bünzli
  2010-06-03 13:27 ` Maxence Guesdon
  0 siblings, 2 replies; 8+ messages in thread
From: Romain Bardou @ 2010-06-03 13:04 UTC (permalink / raw)
  To: caml-list

Hello,

If I put some unicode characters inside an ocamldoc comment, it is 
copied as is, but the browser does not print them correctly because the 
page header does not say that the page is encoded using unicode.

Is there a way I can change the header of the generated pages 
automatically to change the encoding information?

Thanks,

-- 
Romain Bardou


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Ocamldoc and Unicode characters
  2010-06-03 13:04 Ocamldoc and Unicode characters Romain Bardou
@ 2010-06-03 13:20 ` Daniel Bünzli
  2010-06-03 13:27 ` Maxence Guesdon
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Bünzli @ 2010-06-03 13:20 UTC (permalink / raw)
  To: Romain Bardou; +Cc: caml-list

> Is there a way I can change the header of the generated pages automatically to change the encoding information?

AFAIK, no (also had this problem once).

Best,

Daniel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Ocamldoc and Unicode characters
  2010-06-03 13:04 Ocamldoc and Unicode characters Romain Bardou
  2010-06-03 13:20 ` [Caml-list] " Daniel Bünzli
@ 2010-06-03 13:27 ` Maxence Guesdon
  2010-06-03 13:29   ` Maxence Guesdon
  2010-06-03 14:18   ` Daniel Bünzli
  1 sibling, 2 replies; 8+ messages in thread
From: Maxence Guesdon @ 2010-06-03 13:27 UTC (permalink / raw)
  To: caml-list

On Thu, 03 Jun 2010 15:04:42 +0200
Romain Bardou <Romain.Bardou@lri.fr> wrote:

> Hello,
> 
> If I put some unicode characters inside an ocamldoc comment, it is 
> copied as is, but the browser does not print them correctly because the 
> page header does not say that the page is encoded using unicode.
> 
> Is there a way I can change the header of the generated pages 
> automatically to change the encoding information?
> 
> Thanks,
> 
> -- 
> Romain Bardou
> 
> _______________________________________________
> 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
 "<meta content=\"text/html; charset=\"iso-8859-1\" http-equiv=\"Content-Type\">\n"

Somehting like the following code should to the trick:
class my_doc_gen =
  object
    initializer
       character_encoding <-
       "<meta content=\"text/html; charset=\"UTF-8\" http-equiv=\"Content-Type\">\n"
  end

let my_generator = new my_doc_gen
let _ = Odoc_args.set_doc_generator (my_generator :> Odoc_args.doc_generator)

(code not tested)

Hope this helps,

-- 
Maxence Guesdon                             http://yquem.inria.fr/~guesdon/
Service Expérimentation et Développements         https://sed-roc.inria.fr/
INRIA Paris-Rocquencourt                  http://www.inria.fr/rocquencourt/




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Ocamldoc and Unicode characters
  2010-06-03 13:27 ` Maxence Guesdon
@ 2010-06-03 13:29   ` Maxence Guesdon
  2010-06-03 14:18   ` Daniel Bünzli
  1 sibling, 0 replies; 8+ messages in thread
From: Maxence Guesdon @ 2010-06-03 13:29 UTC (permalink / raw)
  To: caml-list

On Thu, 3 Jun 2010 15:27:51 +0200
Maxence Guesdon <Maxence.Guesdon@inria.fr> wrote:

> 
> Somehting like the following code should to the trick:
> class my_doc_gen =
>   object

I forgot:
  inherit Odoc_html.html

...

Regards,

-- 
Maxence Guesdon                             http://yquem.inria.fr/~guesdon/
Service Expérimentation et Développements         https://sed-roc.inria.fr/
INRIA Paris-Rocquencourt                  http://www.inria.fr/rocquencourt/




^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Ocamldoc and Unicode characters
  2010-06-03 13:27 ` Maxence Guesdon
  2010-06-03 13:29   ` Maxence Guesdon
@ 2010-06-03 14:18   ` Daniel Bünzli
  2010-06-03 20:29     ` Maxence Guesdon
  1 sibling, 1 reply; 8+ messages in thread
From: Daniel Bünzli @ 2010-06-03 14:18 UTC (permalink / raw)
  To: Maxence Guesdon; +Cc: caml-list

> I see two easy solutions:

[...]

Sure they are easy but they significantly complicate one's build
system for very little.

A command line switch for this in ocamldoc would be nice and forward
looking (since the rest of the tool suite is perfectly able to deal
directly with UTF-8 encoded sources).

Best,

Daniel


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Ocamldoc and Unicode characters
  2010-06-03 14:18   ` Daniel Bünzli
@ 2010-06-03 20:29     ` Maxence Guesdon
  2010-06-04  5:47       ` David MENTRE
  2010-06-04 11:56       ` Romain Bardou
  0 siblings, 2 replies; 8+ messages in thread
From: Maxence Guesdon @ 2010-06-03 20:29 UTC (permalink / raw)
  To: caml-list

Le Thu, 3 Jun 2010 16:18:43 +0200,
Daniel Bünzli <daniel.buenzli@erratique.ch> a écrit :

> > I see two easy solutions:
> 
> [...]
> 
> Sure they are easy but they significantly complicate one's build
> system for very little.
> 
> A command line switch for this in ocamldoc would be nice and forward
> looking (since the rest of the tool suite is perfectly able to deal
> directly with UTF-8 encoded sources).

Agreed, but 3.12.0 is already in feature freeze. Will be for 3.12.1.

Regards,

Maxence



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Ocamldoc and Unicode characters
  2010-06-03 20:29     ` Maxence Guesdon
@ 2010-06-04  5:47       ` David MENTRE
  2010-06-04 11:56       ` Romain Bardou
  1 sibling, 0 replies; 8+ messages in thread
From: David MENTRE @ 2010-06-04  5:47 UTC (permalink / raw)
  To: Maxence Guesdon; +Cc: caml-list

Hello,

2010/6/3 Maxence Guesdon <maxence.guesdon@inria.fr>:
> Daniel Bünzli <daniel.buenzli@erratique.ch> a écrit :
>> A command line switch for this in ocamldoc would be nice and forward
>> looking (since the rest of the tool suite is perfectly able to deal
>> directly with UTF-8 encoded sources).
>
> Agreed, but 3.12.0 is already in feature freeze. Will be for 3.12.1.

BTW, maybe switching to UTF-8 by default wouldn't be that bad.

Best regards,
d.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Caml-list] Ocamldoc and Unicode characters
  2010-06-03 20:29     ` Maxence Guesdon
  2010-06-04  5:47       ` David MENTRE
@ 2010-06-04 11:56       ` Romain Bardou
  1 sibling, 0 replies; 8+ messages in thread
From: Romain Bardou @ 2010-06-04 11:56 UTC (permalink / raw)
  To: caml-list

On 03/06/2010 22:29, Maxence Guesdon wrote:
> Le Thu, 3 Jun 2010 16:18:43 +0200,
> Daniel Bünzli<daniel.buenzli@erratique.ch>  a écrit :
>
>>> I see two easy solutions:
>>
>> [...]
>>
>> Sure they are easy but they significantly complicate one's build
>> system for very little.
>>
>> A command line switch for this in ocamldoc would be nice and forward
>> looking (since the rest of the tool suite is perfectly able to deal
>> directly with UTF-8 encoded sources).
>
> Agreed, but 3.12.0 is already in feature freeze. Will be for 3.12.1.

Great ! I'll just wait then :p

-- 
Romain Bardou


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-06-04 11:58 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-03 13:04 Ocamldoc and Unicode characters Romain Bardou
2010-06-03 13:20 ` [Caml-list] " Daniel Bünzli
2010-06-03 13:27 ` Maxence Guesdon
2010-06-03 13:29   ` Maxence Guesdon
2010-06-03 14:18   ` Daniel Bünzli
2010-06-03 20:29     ` Maxence Guesdon
2010-06-04  5:47       ` David MENTRE
2010-06-04 11:56       ` Romain Bardou

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).