-
-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use rosetta as default charset conversion library #2701
Conversation
5224df7
to
ffd2107
Compare
81bd061
to
c61c7dd
Compare
c61c7dd
to
4d152b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this work, this is much more complete than my first implementation.
Aparat from the questions in the review, I have a general one: why not simply drop camomile support in favor of rosetta instead of keeping both, which requires introducing a new opam package... ?
Printf.printf "%s\n%!" | ||
[%string "Testing conversion from %{enc_str} to UTF8"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really see the point of adding a dependency on ppx_string
which is not standard here instead of simply using printf
:
Printf.printf "%s\n%!" | |
[%string "Testing conversion from %{enc_str} to UTF8"]; | |
Printf.printf "Testing conversion from %s to UTF8\n%!" enc_str |
It makes the code longer and less readable...
(of course this comment also applies on other prints in the file...)
(camomile -> charset_impl.camomile.ml) | ||
(rosetta -> charset_impl.rosetta.ml) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not keep the "native" implementation? I agree that we should ask for rosetta or camomil in the opam file, but we could still keep the native implementation around to still be able to compile with dune if we have a problem with rosetta, or want to have a small binary etc?
(camomile -> charset_impl.camomile.ml) | |
(rosetta -> charset_impl.rosetta.ml) | |
(camomile -> charset_impl.camomile.ml) | |
(rosetta -> charset_impl.rosetta.ml) | |
(-> charset_impl.native.ml) |
Thanks for the review. I'm not sure that I want to go this route now.. 😅 Moving forward, we want to make sure that everything is encoded with the de-facto In the past, we've had reports about issues with legacy software. See for instance: #411.
However, in this case we do want to give the user a chance to encoding in For ocaml dependencies with external dependencies, it makes sense to make them optional but a package with pure ocaml code should be made mandatory if it's important enough and I believe that our capacity to encode and decode to more than What we should really consider here is a friendly, community supported fork of |
This PRs expand the native charset conversion support to include conversions from the formats supported by
rosetta
and by OCaml version >=4.14
.It also adds tests based on the
camomile
tests dataset.The introduction of
conf-liquidsoap-charset
is because of: ocaml/dune#6284