[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] externals/sly 1188cfc 34/47: Ignore utf-8 encoding errors
From: |
ELPA Syncer |
Subject: |
[nongnu] externals/sly 1188cfc 34/47: Ignore utf-8 encoding errors |
Date: |
Thu, 17 Dec 2020 18:57:20 -0500 (EST) |
branch: externals/sly
commit 1188cfc9923155c70ab03b7f5546ad5a14bb23c3
Author: Stas Boukarev <stassats@gmail.com>
Commit: João Távora <joaotavora@gmail.com>
Ignore utf-8 encoding errors
* slynk/backend/sbcl.lisp (string-to-utf8, utf8-to-string): Rework.
* slynk/slynk-backend.lisp (utf8-decode-aux, utf8-decode): Rework.
Cherry-picked-from: SLIME commit f851763d96fe8aa7f563ad4e00ba06d275316210
Co-authored-by: João Távora <joaotavora@gmail.com>
---
slynk/backend/sbcl.lisp | 8 ++++++--
slynk/slynk-backend.lisp | 12 +++++-------
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/slynk/backend/sbcl.lisp b/slynk/backend/sbcl.lisp
index 487ef93..aeb2ea7 100644
--- a/slynk/backend/sbcl.lisp
+++ b/slynk/backend/sbcl.lisp
@@ -85,10 +85,14 @@
;;; UTF8
(defimplementation string-to-utf8 (string)
- (sb-ext:string-to-octets string :external-format :utf8))
+ (sb-ext:string-to-octets string :external-format '(:utf8 :replacement
+ #+sb-unicode
#\Replacement_Character
+ #-sb-unicode #\? )))
(defimplementation utf8-to-string (octets)
- (sb-ext:octets-to-string octets :external-format :utf8))
+ (sb-ext:octets-to-string octets :external-format '(:utf8 :replacement
+ #+sb-unicode
#\Replacement_Character
+ #-sb-unicode #\? )))
;;; TCP Server
diff --git a/slynk/slynk-backend.lisp b/slynk/slynk-backend.lisp
index 8c5f892..0bb27e1 100644
--- a/slynk/slynk-backend.lisp
+++ b/slynk/slynk-backend.lisp
@@ -291,18 +291,15 @@ form suitable for testing with #+."
(cond ((= (ldb (byte 2 6) byte) #b10)
(+ (ash code 6) (ldb (byte 6 0) byte)))
(t
- (error "Invalid encoding"))))))
+ #xFFFD))))) ;; Replacement_Character
((= i n)
(values (cond ((<= code #xff) (code-char code))
((<= #xd800 code #xdfff)
- (error "Invalid Unicode code point: #x~x" code))
+ (code-char #xFFFD)) ;; Replacement_Character
((and (< code char-code-limit)
(code-char code)))
(t
- (error
- "Can't represent code point: #x~x ~
- (char-code-limit is #x~x)"
- code char-code-limit)))
+ (code-char #xFFFD))) ;; Replacement_Character
(+ index n))))))
;; Decode one character in BUFFER starting at INDEX.
@@ -392,7 +389,8 @@ form suitable for testing with #+."
(t start)))
((<= code #x7ff) (utf8-encode-aux code buffer start end 2))
((<= #xd800 code #xdfff)
- (error "Invalid Unicode code point (surrogate): #x~x" code))
+ (%utf8-encode (code-char #xFFFD) ;; Replacement_Character
+ buffer start end))
((<= code #xffff) (utf8-encode-aux code buffer start end 3))
((<= code #x1fffff) (utf8-encode-aux code buffer start end 4))
((<= code #x3ffffff) (utf8-encode-aux code buffer start end 5))
- [nongnu] externals/sly c794fe6 30/47: Remove recursive locks for clasp, (continued)
- [nongnu] externals/sly c794fe6 30/47: Remove recursive locks for clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 57ffb2a 33/47: sbcl: fix access to &more vars in the debugger, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly dcfe556 02/47: Fixed sldb and backtraces in clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 1dbf876 04/47: ecl: frame-source-location: return error if frame source not found, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly cd85cf6 35/47: Improve xref definitions for M-. in clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 6785833 37/47: clasp: implement profiling via metering, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 1346967 38/47: Remove use of compatibility accessors, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly e914200 07/47: wait-for-input: better "not implemented" error., ELPA Syncer, 2020/12/17
- [nongnu] externals/sly e883812 11/47: Fix SLYNK-SBCL:COMPILER-NOTE-LOCATION for non-file-backed streams, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 425146d 31/47: Print more code-source-location info for clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 1188cfc 34/47: Ignore utf-8 encoding errors,
ELPA Syncer <=
- [nongnu] externals/sly 4717cb9 44/47: Tolerate leading whitespace in slime-search-buffer-package, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 00cbab0 01/47: Slynk: avoid race conditions when killing threads, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 47e8d27 05/47: add architecture :aarch64 (for ECL), ELPA Syncer, 2020/12/17
- [nongnu] externals/sly f7c6048 08/47: arglist-dispatch: better handling of closer-mop wrappers., ELPA Syncer, 2020/12/17
- [nongnu] externals/sly bf157ae 10/47: Changed the name of a function in Clasp, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 57b6d3f 18/47: abcl: consolidate fixes and features, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly e79f9f2 23/47: sbcl: consult sb-impl:+internal-features+ when reading source files., ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 3bd8696 24/47: Move *features* binding up, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 276b18c 39/47: abcl: guard against repeated invocation to SLYNK-BACKEND:WRAP, ELPA Syncer, 2020/12/17
- [nongnu] externals/sly 47afe17 41/47: Fix #386: Unbreak Clasp common lisp for SLYfun, ELPA Syncer, 2020/12/17