From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Josep Portella Florit Newsgroups: gmane.lisp.guile.bugs Subject: bug#22667: string->bytevector encoding error Date: Sun, 14 Feb 2016 23:18:16 +0100 Message-ID: <56C0FD28.9050709@primfilat.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1455488363 21091 80.91.229.3 (14 Feb 2016 22:19:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Feb 2016 22:19:23 +0000 (UTC) To: 22667@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Feb 14 23:19:11 2016 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aV50Y-00054u-OC for guile-bugs@m.gmane.org; Sun, 14 Feb 2016 23:19:11 +0100 Original-Received: from localhost ([::1]:54077 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV50X-0000FZ-LB for guile-bugs@m.gmane.org; Sun, 14 Feb 2016 17:19:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV50U-0000F6-Dd for bug-guile@gnu.org; Sun, 14 Feb 2016 17:19:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aV50Q-0001Rx-Dq for bug-guile@gnu.org; Sun, 14 Feb 2016 17:19:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV50Q-0001Rt-A2 for bug-guile@gnu.org; Sun, 14 Feb 2016 17:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84) (envelope-from ) id 1aV50Q-00030j-6c for bug-guile@gnu.org; Sun, 14 Feb 2016 17:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Josep Portella Florit Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 14 Feb 2016 22:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 22667 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.145548831711539 (code B ref -1); Sun, 14 Feb 2016 22:19:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Feb 2016 22:18:37 +0000 Original-Received: from localhost ([127.0.0.1]:39126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aV501-000303-89 for submit@debbugs.gnu.org; Sun, 14 Feb 2016 17:18:37 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:34860) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aV4zz-0002zr-8a for submit@debbugs.gnu.org; Sun, 14 Feb 2016 17:18:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aV4zs-0001Oq-Ua for submit@debbugs.gnu.org; Sun, 14 Feb 2016 17:18:29 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:51422) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV4zs-0001Om-R3 for submit@debbugs.gnu.org; Sun, 14 Feb 2016 17:18:28 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54064) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV4zs-0008W5-0v for bug-guile@gnu.org; Sun, 14 Feb 2016 17:18:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aV4zo-0001OF-0N for bug-guile@gnu.org; Sun, 14 Feb 2016 17:18:27 -0500 Original-Received: from primfilat.com ([71.19.154.166]:59950) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aV4zn-0001O7-R4 for bug-guile@gnu.org; Sun, 14 Feb 2016 17:18:23 -0500 Original-Received: from [192.168.0.4] (unknown [46.18.40.216]) by primfilat.com (Postfix) with ESMTPSA id A79E47BB52 for ; Sun, 14 Feb 2016 23:18:21 +0100 (CET) X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7961 Archived-At: '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") ;; =3D> #vu8(254 255 0 65 0 65 ...) (string->bytevector (make-string 64 #\A) "UTF-32") ;; =3D> #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")