New Upstream Release - cl-babel
Ready changes
Summary
Merged new upstream version: 20230126.git627d6a6 (was: 20200719.gitf892d05).
Resulting package
Built on 2023-06-10T21:18 (took 10m7s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-releases cl-babel
Lintian Result
Diff
diff --git a/debian/changelog b/debian/changelog
index 08d72c7..90d9d59 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,12 @@
-cl-babel (20200719.gitf892d05-3) UNRELEASED; urgency=medium
+cl-babel (20230126.git627d6a6-1) UNRELEASED; urgency=medium
+ [ Sébastien Villemot ]
* Remove myself from Uploaders
- -- Sébastien Villemot <sebastien@debian.org> Sat, 10 Jun 2023 13:43:22 +0200
+ [ Debian Janitor ]
+ * New upstream release.
+
+ -- Sébastien Villemot <sebastien@debian.org> Sat, 10 Jun 2023 21:09:27 -0000
cl-babel (20200719.gitf892d05-2) unstable; urgency=medium
diff --git a/src/enc-ebcdic.lisp b/src/enc-ebcdic.lisp
index 6977da4..bd3599a 100644
--- a/src/enc-ebcdic.lisp
+++ b/src/enc-ebcdic.lisp
@@ -1,8 +1,9 @@
;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
-;;; enc-ebcdic.lisp --- EBCDIC encodings.
+;;; enc-ebcdic.lisp --- Localized EBCDIC variant encodings.
;;;
;;; Copyright (C) 2007, Luis Oliveira <loliveira@common-lisp.net>
+;;; Copyright (C) 2020, Timo Myyrä <timo.myyra@bittivirhe.fi>
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
@@ -30,6 +31,18 @@
"An alleged character set used on IBM dinosaurs."
:aliases '(:ibm-037))
+(define-character-encoding :ebcdic-us-euro
+ "An alleged character set used on IBM dinosaurs using Euro sign."
+ :aliases '(:ibm-1140))
+
+(define-character-encoding :ebcdic-fi
+ "A character set used on IBM mainframes in Finland/Sweden."
+ :aliases '(:ibm-278))
+
+(define-character-encoding :ebcdic-fi-euro
+ "A character set used on IBM mainframes in Finland/Sweden using Euro sign."
+ :aliases '(:ibm-1143))
+
(define-constant +ebcdic-decode-table+
(make-array
256 :element-type 'ub8 :initial-contents
@@ -69,3 +82,95 @@
(define-unibyte-decoder :ebcdic-us (octet)
(aref +ebcdic-decode-table+ octet))
+
+(define-unibyte-encoder :ebcdic-us-euro (code)
+ (if (>= code 256)
+ (handle-error)
+ (if (= code #x20ac)
+ #x9f
+ (aref +ebcdic-encode-table+ code))))
+
+(define-unibyte-decoder :ebcdic-us-euro (octet)
+ (if (= octet #x9f)
+ #x20ac
+ (aref +ebcdic-decode-table+ octet)))
+
+(defun ebcdic-fi-encoder (code)
+ (if (>= code 256)
+ (handle-error)
+ (or (case code
+ (#x7b #x43)
+ (#x7d #x47)
+ (#xa7 #x4a)
+ (#x21 #x4f)
+ (#x60 #x51)
+ (#xa4 #x5a)
+ (#xc5 #x5b)
+ (#x5e #x5f)
+ (#x23 #x63)
+ (#x24 #x67)
+ (#xf6 #x6a)
+ (#x5c #x71)
+ (#xe9 #x79)
+ (#xc4 #x7b)
+ (#xd6 #x7c)
+ (#x5d #x9f)
+ (#xfc #xa1)
+ (#xa2 #xb0)
+ (#x5b #xb5)
+ (#xac #xba)
+ (#x7c #xbb)
+ (#xe4 #xc0)
+ (#xa6 #xcc)
+ (#xe5 #xd0)
+ (#x7e #xdc)
+ (#xc9 #xe0)
+ (#x40 #xec))
+ (aref +ebcdic-encode-table+ code))))
+
+(defun ebcdic-fi-decoder (octet)
+ (or (case octet
+ (#x43 #x7b)
+ (#x47 #x7d)
+ (#x4a #xa7)
+ (#x4f #x21)
+ (#x51 #x60)
+ (#x5a #xa4)
+ (#x5b #xc5)
+ (#x5f #x5e)
+ (#x63 #x23)
+ (#x67 #x24)
+ (#x6a #xf6)
+ (#x71 #x5c)
+ (#x79 #xe9)
+ (#x7b #xc4)
+ (#x7c #xd6)
+ (#x9f #x5d)
+ (#xa1 #xfc)
+ (#xb0 #xa2)
+ (#xb5 #x5b)
+ (#xba #xac)
+ (#xbb #x7c)
+ (#xc0 #xe4)
+ (#xcc #xa6)
+ (#xd0 #xe5)
+ (#xdc #x7e)
+ (#xe0 #xc9)
+ (#xec #x40))
+ (aref +ebcdic-decode-table+ octet)))
+
+(define-unibyte-encoder :ebcdic-fi (code)
+ (ebcdic-fi-encoder code))
+
+(define-unibyte-decoder :ebcdic-fi (octet)
+ (ebcdic-fi-decoder octet))
+
+(define-unibyte-encoder :ebcdic-fi-euro (code)
+ (if (= code #x20ac)
+ #x5a
+ (ebcdic-fi-encoder code)))
+
+(define-unibyte-decoder :ebcdic-fi-euro (octet)
+ (if (= octet #x5a)
+ #x20ac
+ (ebcdic-fi-decoder octet)))
diff --git a/tests/ebcdic-fi.txt b/tests/ebcdic-fi.txt
new file mode 100644
index 0000000..e69de29
diff --git a/tests/ebcdic-fi.txt-utf8 b/tests/ebcdic-fi.txt-utf8
new file mode 100644
index 0000000..e69de29
diff --git a/tests/tests.lisp b/tests/tests.lisp
index 82c29bb..627f56e 100644
--- a/tests/tests.lisp
+++ b/tests/tests.lisp
@@ -274,7 +274,7 @@ RESULT defaults to `*last-test-result*' and STREAM defaults to t"
(string-size-in-octets foo-string :errorp t)))))))
(deftest iconv-test ()
- (dolist (enc '(:ascii :ebcdic-us :utf-8 :utf-16 :utf-32))
+ (dolist (enc '(:ascii :ebcdic-us :ebcdic-fi :utf-8 :utf-16 :utf-32))
(case enc
(:utf-16 (test-encoding :utf-16 "utf-16-with-le-bom"))
(:utf-32 (test-encoding :utf-32 "utf-32-with-le-bom")))
@@ -910,3 +910,18 @@ RESULT defaults to `*last-test-result*' and STREAM defaults to t"
#+enable-slow-babel-tests
(deftest octet-sweep-all-encodings ()
(mapc #'octet-sweep (list-character-encodings)))
+
+;; Test currency sign on localized ebcdic encodings
+(deftest ebcdic-fi-diaeresis-and-euro ()
+ (let ((utf8-diaeresis-string "ÄäöÖ")
+ (utf8-euro-string "€")
+ (ebcdic-diaeresis-expected (make-array 4 :element-type '(unsigned-byte 8)
+ :initial-contents '(#x7b #xc0 #x6a #x7c)))
+ (ebcdic-euro-expected (make-array 1 :element-type '(unsigned-byte 8)
+ :initial-contents '(#x5a))))
+ (is (equalp (babel:octets-to-string ebcdic-diaeresis-expected :encoding :ebcdic-fi)
+ utf8-diaeresis-string))
+ (is (equalp (babel:octets-to-string ebcdic-diaeresis-expected :encoding :ebcdic-fi-euro)
+ utf8-diaeresis-string))
+ (is (equalp (babel:octets-to-string ebcdic-euro-expected :encoding :ebcdic-fi-euro)
+ utf8-euro-string))))
Debdiff
[The following lists of changes regard files as different if they have different names, permissions or owners.]
Files in second set of .debs but not in first
-rw-r--r-- root/root /usr/share/common-lisp/source/babel/tests/ebcdic-fi.txt -rw-r--r-- root/root /usr/share/common-lisp/source/babel/tests/ebcdic-fi.txt-utf8
No differences were encountered in the control files