Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

simplify the tail of utf-8 decoding a bit

  Seems pointless to identify additional bogus bytes.
  • Loading branch information...
commit 20d27852c1a7801cd98a3a5e5135da56033fe130 1 parent 2f4e3b3
@nikodemus authored
Showing with 1 addition and 15 deletions.
  1. +1 −15 enc-utf8.lisp
View
16 enc-utf8.lisp
@@ -139,21 +139,7 @@
(ash (logxor #x80 byte3) 6)
(logxor #x80 byte4))))
(t
- (with-byte (byte5 (byte byte2 byte3 byte4))
- ((and (= byte #xf8) (< byte2 #x88))
- ;; overlong
- (utf-8-error byte byte2 byte3 byte4 byte5))
- ((< byte #xfc)
- ;; character out of range
- (utf-8-error byte byte2 byte3 byte4 byte5))
- (t
- (with-byte (byte6 (byte byte2 byte3 byte4 byte5))
- ((and (= byte #xfc) (< byte2 #x84))
- ;; overlong
- (utf-8-error byte byte2 byte3 byte4 byte5 byte6))
- (t
- ;; character out of range
- (utf-8-error byte byte2 byte3 byte4 byte5 byte6))))))))))))))))
+ (utf-8-error byte byte2 byte3 byte4))))))))))))
skip))
(define-character-encoding :utf-8b)
Please sign in to comment.
Something went wrong with that request. Please try again.