;COMMON-CHARACTER-SETS - Determine within reason the character sets supported by the implementation. ;Written in 2019 by Prince Trippy programmer@verisimilitudes.net . ;To the extent possible under law, the author(s) have dedicated all copyright ;and related and neighboring rights to this software to the public domain worldwide. ;This software is distributed without any warranty. ;You should have received a copy of the CC0 Public Domain Dedication along with this software. ;If not, see . (in-package #:cl) ;Currently, I only have ASCII detection, but I'll be adding others soon. (let ((set (make-array 128 :initial-contents (loop :for integer :from 0 :to 127 :collect (ignore-errors (code-char integer))))) (string (concatenate 'string ;I decided to keep the lines less than 100 columns. " !\"#$%&'()*+,-./0123456789:;<=>?@" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "[\\]^_`" "abcdefghijklmnopqrstuvwxyz" "{|}~"))) (and (>= char-code-limit 127) (notany 'null set) (loop :for integer :from #x30 :to #x39 :always (digit-char-p (aref set integer))) (loop :for integer :from 0 :to 31 :never (graphic-char-p (aref set integer))) (not (graphic-char-p (aref set 127))) (loop :for integer :from 32 :to 126 :always (and (graphic-char-p (aref set integer)) (char= (aref set integer) (char string (- integer 32))))) (loop :for integer :from 65 :to 90 :always (and (alpha-char-p (aref set integer)) (alpha-char-p (aref set (+ 32 integer))) (char= (char-downcase (aref set integer)) (aref set (+ 32 integer))))) (pushnew :ascii *features*))) .