Skip to content

Commit

Permalink
feat: account for Japanese whitespace (#120)
Browse files Browse the repository at this point in the history
Use `code-char` for abcl, cl, lispworks
  • Loading branch information
fosskers authored Jun 28, 2024
1 parent b9d14b4 commit 256156c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions str.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
(defvar *whitespaces* (list #\Backspace #\Tab #\Linefeed #\Newline #\Vt #\Page
#\Return #\Space #\Rubout
#+sbcl #\Next-Line #-sbcl (code-char 133)
#+(or abcl gcl lispworks) (code-char 12288) #-(or abcl gcl lispworks) #\Ideographic_space
#+lispworks #\no-break-space #-lispworks #\No-break_space)
"On some implementations, linefeed and newline represent the same character (code).")

Expand Down
3 changes: 2 additions & 1 deletion test/test-str.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@
(test trim
(is (string= "rst" (trim " rst ")))
(is (string= nil (trim nil)))
(is (string= "rst" (trim "drste" :char-bag "de"))))
(is (string= "rst" (trim "drste" :char-bag "de")))
(is (string= "rst" (trim "  rst   "))))

(test trim-right
(is (string= " rst" (trim-right " rst ")))
Expand Down

0 comments on commit 256156c

Please sign in to comment.