diff --git a/init.cfg b/init.cfg index 531bc386e..b741520a5 100644 --- a/init.cfg +++ b/init.cfg @@ -888,7 +888,15 @@ bad_unicode () require_built_ printf # invalid UTF8|unpaired surrogate|C1 control|noncharacter - env printf '\xFF|\xED\xBA\xAD|\u0089|\xED\xA6\xBF\xED\xBF\xBF\n' + local format='\xFF|\xED\xBA\xAD|\u0089|\xED\xA6\xBF\xED\xBF\xBF\n' + local bytes + # dash 0.5.13 can corrupt non ASCII during variable assignment. + bytes=$(env printf "$format") + if test "$bytes" != "$(env printf "$format")"; then + warn_ 'shell cannot preserve invalid Unicode bytes; using ASCII instead' + bytes='not_bad_unicode' + fi + printf '%s\n' "$bytes" } # AIX has a 'strace' program unrelated to the one we care about. Avoid diff --git a/tests/du/block-size.sh b/tests/du/block-size.sh index f4573bef8..086955e8d 100755 --- a/tests/du/block-size.sh +++ b/tests/du/block-size.sh @@ -60,6 +60,9 @@ test_unit () { test -z "$loc" || test "$loc" = none; } && continue if test $loc != C; then thousands_sep=$(LC_ALL=$loc locale thousands_sep) + # dash 0.5.13 corrupts non-ASCII bytes during variable assignment. + test "$thousands_sep" = "$(LC_ALL=$loc locale thousands_sep)" || + skip_ 'shell cannot preserve locale thousands separator' grouping=$(LC_ALL=$loc locale grouping) test -z "$thousands_sep" && continue test "$grouping" != 3 && continue diff --git a/tests/paste/multi-byte.sh b/tests/paste/multi-byte.sh index 85b1443e7..54c51b9dd 100755 --- a/tests/paste/multi-byte.sh +++ b/tests/paste/multi-byte.sh @@ -32,6 +32,11 @@ delim_euro=$(env printf '\xe2\x82\xac') # UTF-8 test: 4-byte character (e.g., emoji: U+1F600) delim_emoji=$(env printf '\xf0\x9f\x98\x80') +# dash 0.5.13 corrupts UTF-8 bytes during variable assignment. +test "$delim_cent$delim_euro$delim_emoji" = \ + "$(env printf '\xc2\xa2\xe2\x82\xac\xf0\x9f\x98\x80')" || + skip_ 'shell cannot preserve UTF-8 delimiters' + printf '1\n2\n' > f1 || framework_failure_ printf 'a\nb\n' > f2 || framework_failure_