octets to string error

Bug #1973200 reported by other-otter.app
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Invalid
Undecided
Unassigned

Bug Description

(handler-case
    (map 'string #'code-char
        (sb-ext:string-to-octets
            (format nil "
北约军火商:煽风点火,抱薪救火,火上浇油.
欧洲平民家:飞来横祸,六月飞霜,雪上加霜.")))
    (error () (print "
全球供应链:冰火两重,困难重重,难上加难.")))

(map 'string #'code-char (sb-ext:string-to-octets "阿拉丁神灯")) ;;something error

;;sbcl 2.2.4 on rocky linux 8.5

Tags: sb-ext
description: updated
description: updated
description: updated
description: updated
Revision history for this message
Stas Boukarev (stassats) wrote :

It's not clear what you are doing.

Changed in sbcl:
status: New → Incomplete
Revision history for this message
other-otter.app (other-otter) wrote (last edit ):

;please try the following expression in sbcl, thanks a lot.
;some string will error and some not, please help.

(map 'string #'code-char (sb-ext:string-to-octets "阿拉丁神灯"))

Revision history for this message
Stas Boukarev (stassats) wrote :

Works as expected.

Revision history for this message
other-otter.app (other-otter) wrote :

;sbcl 2.2.4.123

(map 'string #'code-char #(233)) ;;"é"

(map 'string #'code-char #(152)) ;;terminal repl error

(map 'string #'code-char #(191)) ;;"¿"

(map 'string #'code-char #(233 152 191)) ;;terminal repl error

*features*

#|
(:X86-64 :GENCGC :64-BIT :ANSI-CL :COMMON-LISP :ELF :IEEE-FLOATING-POINT :LINUX
 :LITTLE-ENDIAN :PACKAGE-LOCAL-NICKNAMES :SB-LDB :SB-PACKAGE-LOCKS :SB-THREAD
 :SB-UNICODE :SBCL :UNIX)
|#

Revision history for this message
Stas Boukarev (stassats) wrote :

Maybe your terminal can't encode these? This produces garbage anyway, so I guess don't try to print them.

Revision history for this message
other-otter.app (other-otter) wrote :

;thanks a lot

(code-char 152)
;#\Start-String

;no problem with sb-ext
(sb-ext:octets-to-string (sb-ext:string-to-octets "阿拉丁"))

;not a bug, invalid

Stas Boukarev (stassats)
Changed in sbcl:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers