Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Variable encoding with netulex
@ 2007-04-10 12:16 Till Varoquaux
  2007-04-10 13:03 ` [Caml-list] " Gerd Stolpmann
  0 siblings, 1 reply; 2+ messages in thread
From: Till Varoquaux @ 2007-04-10 12:16 UTC (permalink / raw)
  To: ocaml ml

I would like to parse a file where the encoding could vary on the fly.
Using Ulex that was quite easy (using form var_enc_channel). What
would be the cannonical way to emulate such a behaviour with netulex?

Regards,

Till Varoquaux


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

* Re: [Caml-list] Variable encoding with netulex
  2007-04-10 12:16 Variable encoding with netulex Till Varoquaux
@ 2007-04-10 13:03 ` Gerd Stolpmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Stolpmann @ 2007-04-10 13:03 UTC (permalink / raw)
  To: Till Varoquaux; +Cc: ocaml ml

Am Dienstag, den 10.04.2007, 14:16 +0200 schrieb Till Varoquaux:
> I would like to parse a file where the encoding could vary on the fly.
> Using Ulex that was quite easy (using form var_enc_channel). What
> would be the cannonical way to emulate such a behaviour with netulex?

I would say this is not possible. Netulex always reads characters in
advance (to improve performance). There is a set_encoding function, but
it only affects the next refill (after all read characters are scanned),
but it is almost impossible to control when this happens.

As the read-ahead buffer was the main motivation to write Netulex, my
advice is to stick to plain Ulex. Buffers and encoding changes are hard
to get right at the same time.

Gerd
-- 
------------------------------------------------------------
Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany 
gerd@gerd-stolpmann.de          http://www.gerd-stolpmann.de
Phone: +49-6151-153855                  Fax: +49-6151-997714
------------------------------------------------------------


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

end of thread, other threads:[~2007-04-10 13:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-10 12:16 Variable encoding with netulex Till Varoquaux
2007-04-10 13:03 ` [Caml-list] " Gerd Stolpmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox