unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#22667: string->bytevector encoding error
@ 2016-02-14 22:18 Josep Portella Florit
  2016-03-03 17:55 ` Mark H Weaver
  2016-06-20 16:07 ` Andy Wingo
  0 siblings, 2 replies; 4+ messages in thread
From: Josep Portella Florit @ 2016-02-14 22:18 UTC (permalink / raw)
  To: 22667

'string->bytevector' throws 'encoding-error' when the encoding is
"UTF-16" and the length of the string is greater than 128.  The same
for the encoding "UTF-32" and a string of length greater than 64.

Tested on Guile 2.0.11 and 2.1.2 with the same result.

How to reproduce:

(use-modules (ice-9 iconv))

;; These expressions evaluate as expected:
(string->bytevector (make-string 128 #\A) "UTF-16")
;; => #vu8(254 255 0 65 0 65 ...)
(string->bytevector (make-string 64 #\A) "UTF-32")
;; => #vu8(0 0 254 255 0 0 0 65 0 0 0 65 ...)

;; These expressions throw 'encoding-error':
(string->bytevector (make-string 129 #\A) "UTF-16")
(string->bytevector (make-string 65 #\A) "UTF-32")





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-07 21:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-14 22:18 bug#22667: string->bytevector encoding error Josep Portella Florit
2016-03-03 17:55 ` Mark H Weaver
2016-06-20 16:07 ` Andy Wingo
2016-08-07 21:25   ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).