-
Notifications
You must be signed in to change notification settings - Fork 414
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: handle utf8 characters in the dune files(#9728) Signed-off-by: Alpha DIALLO <[email protected]> Signed-off-by: Etienne Millon <[email protected]> * Add the changes file and revert the modification of the lexer Signed-off-by: Alpha DIALLO <[email protected]> Signed-off-by: Etienne Millon <[email protected]> * Use uutf Also leaving a note about using the stdlib later. Signed-off-by: Etienne Millon <[email protected]> * changelog Signed-off-by: Etienne Millon <[email protected]> --------- Signed-off-by: Alpha DIALLO <[email protected]> Signed-off-by: Etienne Millon <[email protected]> Co-authored-by: Etienne Millon <[email protected]>
- Loading branch information
1 parent
62dadbe
commit 171c231
Showing
5 changed files
with
100 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- dune file formatting: output utf8 if input is correctly encoded (#10113, | ||
fixes #9728, @moyodiallo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 25 additions & 3 deletions
28
test/blackbox-tests/test-cases/formatting/non-ascii-characters.t
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,35 @@ | ||
How the non-ASCII characters are handled, this is also related to the issue #9728 | ||
Utf8 characters are handled for now, this is also related to the issue #9728 | ||
|
||
$ dune format-dune-file <<EOF | ||
> ("É") | ||
> ("Éff ĎúÑȨ") | ||
> EOF | ||
("\195\137") | ||
("Éff ĎúÑȨ") | ||
|
||
$ dune format-dune-file <<EOF | ||
> (run foo %{bin:é}) | ||
> EOF | ||
File "", line 1, characters 15-16: | ||
Error: The character '\195' is not allowed inside %{...} forms | ||
[1] | ||
|
||
$ dune format-dune-file <<EOF | ||
> (echo "hÉllo") | ||
> EOF | ||
(echo "hÉllo") | ||
|
||
$ dune format-dune-file <<EOF | ||
> (echo "É") | ||
> EOF | ||
(echo "É") | ||
|
||
$ dune format-dune-file <<EOF | ||
> (Écho "hello") | ||
> EOF | ||
File "", line 1, characters 1-1: | ||
Error: Invalid . file | ||
[1] | ||
|
||
$ bash -c "printf '(echo \"%b\")' '\xc0'"| dune format-dune-file | ||
(echo "\192") | ||
$ bash -c "printf '(echo \"%b\")' '\xf0'"| dune format-dune-file | ||
(echo "\240") |