Raymond Toy pushed to branch issue-367-count-octets-for-encoding at cmucl / cmucl Commits: ccd15fce by Raymond Toy at 2025-01-13T12:40:36-08:00 Add octet-count for mac-roman format with corresponding test This also means all the cp12??, koi8-5, mac-greek, mac-icelandic, mac-latin2, and mac-turkish also has octet-count now too since mac-roman is the base for these other formats. - - - - - 2 changed files: - src/pcl/simple-streams/external-formats/mac-roman.lisp - tests/external-formats.lisp Changes: ===================================== src/pcl/simple-streams/external-formats/mac-roman.lisp ===================================== @@ -49,4 +49,19 @@ character and illegal outputs are replaced by a question mark.") (declare (optimize (ext:inhibit-warnings 3))) (funcall ,error "Cannot output codepoint #x~X to MAC-ROMAN stream" ,code)) - #x3F))))))) + #x3F)))))) + () + () + (octet-count (code state error present) + `(if (< ,code 128) + 1 + (let ((,present (get-inverse ,itable ,code))) + (if ,present + 1 + (if ,error + (locally + ;; No warnings about fdefinition + (declare (optimize (ext:inhibit-warnings 3))) + (funcall ,error "Cannot output codepoint #x~X to MAC-ROMAN stream" + ,code)) + 1)))))) ===================================== tests/external-formats.lisp ===================================== @@ -108,5 +108,8 @@ (:tag :octet-count) (test-octet-count *test-iso8859-1* :iso8859-15)) - +(define-test octet-count.mac-roman + (:tag :octet-count) + (test-octet-count *test-iso8859-1* :mac-roman)) + View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/ccd15fcecd9a55e61b22a7fb... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/commit/ccd15fcecd9a55e61b22a7fb... You're receiving this email because of your account on gitlab.common-lisp.net.