sb-impl:read-from-c-string/* report undecodable octets incorrectly

Bug #710626 reported by 3b on 2011-01-31
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Medium
Unassigned

Bug Description

(cffi:with-foreign-string (a (string (code-char #xff)) :encoding :iso-8859-1)
  (sb-impl::read-from-c-string/ascii a 'character))

gives the error:

c-string decoding error (:external-format :ASCII):
  the octet sequence 1 cannot be decoded.
   [Condition of type SB-INT:C-STRING-DECODING-ERROR]

expected something describing the octets that could not be decoded (#xff in this case) rather than always 1

(cffi:with-foreign-string (a (string (code-char #xff)) :encoding :iso-8859-1)
  (sb-impl::read-from-c-string/utf-8 a 'character))

produces
c-string decoding error (:external-format :UTF-8):
  the octet sequence 4 cannot be decoded.
   [Condition of type SB-INT:C-STRING-DECODING-ERROR]

the '4' in the error message varies from 1 to 4 depending on the octet sequence, but still doesn't not show the actual octets

tested on "1.0.45.13", x8664 linux

Nikodemus Siivola (nikodemus) wrote :

Looks like there's confusion re. meaning of DECODE-BREAK-REASON in the source.

Changed in sbcl:
importance: Undecided → Medium
status: New → Triaged
tags: added: external-formats
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers