Steel Bank Common Lisp

octets-to-string use-value does not function properly with EUC-JP encoding

Reported by Tapio Saarinen on 2009-01-08
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

(defvar *euc-jp* (drakma:http-request "" :external-format-in :euc-jp :external-format-out :euc-jp))

;;The following works as expected:
(handler-bind ((sb-int:character-decoding-error
                         #'(lambda (c)
                             (invoke-restart 'use-value #\?))))
             (sb-ext:octets-to-string *euc-jp* :external-format :ascii))

;;This, however, does not, complaining that "?" is not a character:
(handler-bind ((sb-int:character-decoding-error
                         #'(lambda (c)
                             (invoke-restart 'use-value #\?))))
             (sb-ext:octets-to-string *euc-jp* :external-format :euc-jp))

Found on 1.0.18, same behavior is exhibited by 1.0.23 and CVS HEAD.

uname -a:
Linux Whimsy 2.6.27-ARCH #1 SMP PREEMPT Sat Nov 8 10:11:43 UTC 2008 i686 Intel(R) Pentium(R) Dual CPU T2370 @ 1.73GHz GenuineIntel GNU/Linux

*FEATURES* (SBCL-1.0.18)

description: updated
Changed in sbcl:
importance: Undecided → Medium
status: New → Confirmed
Matthias Benkard (mulk) wrote :

For my brief analysis of the problem, see:

In short, I think there might be a bug in mb-util.lisp. I haven't looked at the current version of the source, so this may or may not have been fixed since 1.0.18.


 status inprogress
 tag external-formats octets

I have committed what I think is a fix for this into my external-formats
branch, available at
From git, viewable at

I'd appreciate it if you could check to see that my fix actually works
for your purposes; I am not a user of any of the multibyte encodings
defined through mb-util, so it would be good to know that I haven't
broken anything else and that this does in fact fix this problem.



Changed in sbcl:
status: Confirmed → In Progress


 status fixcommitted

I merged my external-formats branch as the commits between and I think the fix for this bug was in sbcl-; I hope
it works for you.


Changed in sbcl:
status: In Progress → Fix Committed

Sorry for the delay in responding. Everything seems to be working fine using the latest SBCL sources which is great.



Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers