Coerce to a character.
(char-fix x) is the identity on characters, and returns the NUL character (i.e., the character whose code is 0) for any non-character.
This is similar to other fixing functions like fix and nfix. See also chareqv.
(defun char-fix$inline (x) (declare (xargs :guard t)) (if (characterp x) x (code-char 0)))
(defthm characterp-of-char-fix (characterp (char-fix x)) :rule-classes :type-prescription)
(defthm char-fix-default (implies (not (characterp x)) (equal (char-fix x) (code-char 0))))
(defthm char-fix-when-characterp (implies (characterp x) (equal (char-fix x) x)))