dune icon indicating copy to clipboard operation
dune copied to clipboard

Synopsis & description characters are escaped

Open toastal opened this issue 5 months ago • 9 comments

Expected Behavior

Dune format does nothing:

(package
 (name cafe_menu_mgr)
 (synopsis "Menu manager for a café named, กาแฟ")
 (description "Add & remove items from กาแฟ’s menu, manage prices, etc."))

Actual Behavior

Dune formats does:

(package
 (name cafe_menu_mgr)
 (synopsis
  "Menu manager for a caf\195\169 named, \224\184\129\224\184\178\224\185\129\224\184\159")
 (description
  "Add & remove items from \224\184\129\224\184\178\224\185\129\224\184\159\226\128\153s menu, manage prices, etc."))

Reproduction

  • PR with a reproducing test:
  1. Init a project
  2. Add non-ASCII characters to synopsis / description
  3. Dune Format

Specifications

  • Version of dune (output of dune --version): 3.12.1
  • Version of ocaml (output of ocamlc --version): 4.14.1
  • Operating system (distribution and version): Fedora Linux 39

Additional information

Discovered here: https://discuss.ocaml.org/t/why-can-t-i-create-a-project-with-non-ascii-characters/13865/12

@yawaramin says this shouldn’t happen for certain fields so they can still be human-readable.

toastal avatar Jan 14 '24 02:01 toastal