;; ========================================== ;; Script: findchars.r ;; downloaded from: www.REBOL.org ;; on: 29-Mar-2024 ;; at: 15:23:14.818775 UTC ;; owner: carl [script library member who can ;; update this script] ;; ========================================== REBOL [ Title: "Find Invalid Chars" Date: 4-Jun-1998 File: %findchars.r Author: "Carl Sassenrath" Purpose: "Finds odd unprintable ASCII characters in a file" library: [ level: 'intermediate platform: none type: none domain: [file-handling text-processing] tested-under: none support: none license: none see-also: none ] ] bad-chars: complement charset ["^I^J^M" #" " - #"~"] file: to-file ask "Filename? " data: read/binary file forall data [ if find bad-chars first data [ print ["Bad char at" index? data] print mold to-string copy/part data 10 ] ]