* [Caml-list] Encodings for ocaml sources
@ 2019-05-22 1:16 Андрей Бергман
2019-05-22 7:01 ` Daniel Bünzli
0 siblings, 1 reply; 2+ messages in thread
From: Андрей Бергман @ 2019-05-22 1:16 UTC (permalink / raw)
To: caml-list
Hello!
Do I understand it right, that currently Ocaml compiler can compile programs, written in
Latin1, various 8-bit encodings with Latin1 base (character code < 128) and UTF-8,
all the identifiers should be within Latin1 base, while string literals can contain any characters?
And UTF-16 is not supported - am I correct?
And this is pretty much the same for all Windows/Linux/OSX?
Sincerely,
Andrey.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Caml-list] Encodings for ocaml sources
2019-05-22 1:16 [Caml-list] Encodings for ocaml sources Андрей Бергман
@ 2019-05-22 7:01 ` Daniel Bünzli
0 siblings, 0 replies; 2+ messages in thread
From: Daniel Bünzli @ 2019-05-22 7:01 UTC (permalink / raw)
To: caml-list,
Андрей
Бергман
On 22 May 2019 at 03:16:46, Андрей Бергман (vkni@yandex.ru) wrote:
> Latin1, various 8-bit encodings with Latin1 base (character code < 128) and UTF-8,
> all the identifiers should be within Latin1 base,
Latin1 identifiers are deprecated, see [1].
> while string literals can contain any characters?
Yes IIRC they can contain arbitrary *bytes*. But a forward looking habit would be to stick to UTF-8 encoded literals rather use arbitrary bytes and avoid US-ASCII control characters except for white space.
> And UTF-16 is not supported - am I correct?
Yes. Strictly speaking because of the preceeding you can UTF-16 encode the string literals, but for the rest of the program that wouldn't work, the lexer wouldn't recognize the keywords.
> And this is pretty much the same for all Windows/Linux/OSX?
Yes.
Best,
Daniel
[1]: https://caml.inria.fr/pub/docs/manual-ocaml/lex.html#sec77
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-05-22 7:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22 1:16 [Caml-list] Encodings for ocaml sources Андрей Бергман
2019-05-22 7:01 ` Daniel Bünzli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox