GNU bug report logs - #22667
string->bytevector encoding error

Previous Next

Package: guile;

Reported by: Josep Portella Florit <jpf <at> primfilat.com>

Date: Sun, 14 Feb 2016 22:19:02 UTC

Severity: normal

Done: Andy Wingo <wingo <at> pobox.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Andy Wingo <wingo <at> pobox.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#22667: closed (string->bytevector encoding error)
Date: Sun, 07 Aug 2016 21:26:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 07 Aug 2016 23:25:29 +0200
with message-id <87y448nueu.fsf <at> pobox.com>
and subject line Re: bug#22667: string->bytevector encoding error
has caused the debbugs.gnu.org bug report #22667,
regarding string->bytevector encoding error
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
22667: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=22667
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Josep Portella Florit <jpf <at> primfilat.com>
To: bug-guile <at> gnu.org
Subject: string->bytevector encoding error
Date: Sun, 14 Feb 2016 23:18:16 +0100
'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")


[Message part 3 (message/rfc822, inline)]
From: Andy Wingo <wingo <at> pobox.com>
To: Josep Portella Florit <jpf <at> primfilat.com>
Cc: 22667-done <at> debbugs.gnu.org
Subject: Re: bug#22667: string->bytevector encoding error
Date: Sun, 07 Aug 2016 23:25:29 +0200
Hi,

On Mon 20 Jun 2016 18:07, Andy Wingo <wingo <at> pobox.com> writes:

> On Sun 14 Feb 2016 23:18, Josep Portella Florit <jpf <at> primfilat.com> writes:
>
>> (use-modules (ice-9 iconv))
>> ;; These expressions throw 'encoding-error':
>> (string->bytevector (make-string 129 #\A) "UTF-16")
>> (string->bytevector (make-string 65 #\A) "UTF-32")
>
> For what it's worth, this appears to be fixed in 2.1.3.  However we
> should fix 2.0 as well.

Fixed.  Thanks for the report, and thanks to Mark for diagnosing the
problem.

Andy.


This bug report was last modified 8 years and 289 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.