Commit 9999ef2
committed
Fix parser translator when unescaping invalid utf8
1. The string starts out as binary
2. `ち` is appended, forcing it back into utf-8
3. Some invalid byte sequences are tried to append
> incompatible character encodings: UTF-8 and BINARY (ASCII-8BIT)
This makes use of my wish to use `append_as_bytes`. Unfortunatly that method is rather new
so it needs a fallback1 parent 01cbec9 commit 9999ef2
File tree
4 files changed
+85
-65
lines changed- lib/prism/translation/parser
- test/prism
- fixtures
- ruby
- snapshots
4 files changed
+85
-65
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
641 | | - | |
| 641 | + | |
642 | 642 | | |
643 | 643 | | |
644 | 644 | | |
645 | | - | |
| 645 | + | |
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
649 | | - | |
650 | | - | |
| 649 | + | |
651 | 650 | | |
652 | 651 | | |
653 | 652 | | |
654 | | - | |
| 653 | + | |
655 | 654 | | |
656 | 655 | | |
657 | 656 | | |
658 | | - | |
| 657 | + | |
659 | 658 | | |
660 | 659 | | |
661 | 660 | | |
662 | 661 | | |
663 | 662 | | |
664 | 663 | | |
665 | 664 | | |
666 | | - | |
| 665 | + | |
667 | 666 | | |
668 | 667 | | |
669 | 668 | | |
670 | 669 | | |
671 | 670 | | |
672 | 671 | | |
673 | | - | |
| 672 | + | |
674 | 673 | | |
675 | 674 | | |
676 | 675 | | |
| |||
687 | 686 | | |
688 | 687 | | |
689 | 688 | | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
690 | 701 | | |
691 | 702 | | |
692 | 703 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments