chiark / gitweb /
quoting of weird chars
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Jan 2012 17:45:16 +0000 (17:45 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 8 Jan 2012 17:45:16 +0000 (17:45 +0000)
mkrules

diff --git a/mkrules b/mkrules
index 734e2a2ca82d91c2f473cbea60cf8dae9f694ac1..ea3afebc09496658f57592fb5170006354ac081f 100755 (executable)
--- a/mkrules
+++ b/mkrules
@@ -6,7 +6,19 @@ rm -f rules/*.rules rules/foundries.new
 
 chars () {
        for c in $rest; do
 
 chars () {
        for c in $rest; do
-               ord=`perl -e 'print ord($ARGV[0]),"\n" or die $!' "$c"`
+               case " $c " in
+               " "?" ")
+                       ord=`perl -e 'print ord($ARGV[0]),"\n" or die $!' "$c"`
+                       ;;
+               " "d?*" ")
+                       ord="${c#d}"
+                       c=`perl -e 'printf "%c", $ARGV[0]' "$ord"`
+                       ;;
+               *)
+                       echo >&2 "??? $c"
+                       exit 1
+                       ;;
+               esac
                ./printrule >&3 "$bad" "$good" $height \
                        "^ENCODING $ord$" $partial "$c"
        done
                ./printrule >&3 "$bad" "$good" $height \
                        "^ENCODING $ord$" $partial "$c"
        done