Commit 7e7edb1
committed
fix(date): remove UTF-8 validation error for non-UTF-8 format strings
This commit removes the strict UTF-8 validation that was previously enforced on Unix systems when using custom format strings with the date command. Previously, if a format string contained invalid UTF-8 bytes and the locale was set to UTF-8, the command would fail with an error. Now, the command will always attempt to decode format strings in a byte-preserving manner, allowing non-UTF-8 format strings to work regardless of the locale setting.
The change simplifies the behavior by removing the conditional UTF-8 validation logic and associated error handling, making the date command more permissive with format strings containing invalid UTF-8 sequences.1 parent 69b763e commit 7e7edb1
2 files changed
Lines changed: 29 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | | - | |
26 | | - | |
27 | 24 | | |
28 | 25 | | |
29 | 26 | | |
| |||
128 | 125 | | |
129 | 126 | | |
130 | 127 | | |
131 | | - | |
132 | | - | |
133 | 128 | | |
134 | 129 | | |
135 | 130 | | |
| |||
373 | 368 | | |
374 | 369 | | |
375 | 370 | | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | 371 | | |
384 | 372 | | |
385 | 373 | | |
| |||
748 | 736 | | |
749 | 737 | | |
750 | 738 | | |
751 | | - | |
752 | 739 | | |
753 | 740 | | |
754 | 741 | | |
| |||
757 | 744 | | |
758 | 745 | | |
759 | 746 | | |
760 | | - | |
| 747 | + | |
761 | 748 | | |
762 | 749 | | |
763 | 750 | | |
764 | 751 | | |
765 | 752 | | |
766 | 753 | | |
767 | | - | |
768 | | - | |
769 | | - | |
| 754 | + | |
770 | 755 | | |
771 | 756 | | |
772 | 757 | | |
| |||
775 | 760 | | |
776 | 761 | | |
777 | 762 | | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | 763 | | |
782 | 764 | | |
783 | 765 | | |
| |||
797 | 779 | | |
798 | 780 | | |
799 | 781 | | |
800 | | - | |
801 | | - | |
802 | | - | |
803 | | - | |
804 | | - | |
805 | | - | |
806 | | - | |
807 | | - | |
808 | | - | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | 782 | | |
822 | 783 | | |
823 | 784 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
432 | 432 | | |
433 | 433 | | |
434 | 434 | | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
435 | 462 | | |
436 | 463 | | |
437 | 464 | | |
| |||
0 commit comments