Browse Source

Replace, don't remove control characters

Make it more consistent with other similar functions.  Note that one can
always get the old behavior by setting $COERCE__REPCHAR to empty string.
Alois Mahdal 5 years ago
parent
commit
d7193295d0
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/include-sh/coerce.sh

+ 2
- 2
src/include-sh/coerce.sh View File

@@ -25,9 +25,9 @@ coerce__nocolor() {
25 25
 
26 26
 coerce__noctl() {
27 27
     #
28
-    # Remove non-printable characters
28
+    # Replace non-printable characters with $COERCE__REPCHAR
29 29
     #
30
-    perl -CS -Mutf8 -pe "s|[^[:graph:] \t\n]||g"
30
+    perl -CS -Mutf8 -pe "s|[^[:graph:] \t\n]|$COERCE__REPCHAR|g"
31 31
 }
32 32
 
33 33
 coerce__nofdraw() {