This site is a static rendering of the Trac instance that was used by R7RS-WG1 for its work on R7RS-small (PDF), which was ratified in 2013. For more information, see Home.

Source for ticket #464

cc


    

changetime

2012-10-07 12:39:38

component

WG1 - Core

description

In response Marijn's message below, I'm adding a proposal to the ballot
that we support optional start and end parameters to `utf8->string` and
to `string->utf8`.

Date: Fri, 13 Jul 2012 09:51:10 +0200
From: Marijn <hkBst@gentoo.org>
Subject: [Scheme-reports] decoding strings from bytevectors

Hi,

I recently ran into this minor issue writing some R6RS code and would
like to know how R7RS addresses it.

Say you want to extract a string from a bytevector, but the bytevector
contains other information before and after the bytes that encode the
string data. In R6RS, AFAIK, you have to copy those bytes to a new
bytevector and then decode that entire bytevector to a string
(probably causing another copy operation). I think it would be useful
if something like


(define (string-decoder bytevector position length transcoder
  (bytevector->string
   (let ((bv (make-bytevector length)))
     (bytevector-copy!
      bytevector position bv 0 length)
     bv)
   transcoder) )


were supported directly by bytevector->string without the additional
bytevector-copy.

Marijn

id

464

keywords


    

milestone


    

owner

cowan

priority

major

reporter

aag

resolution

fixed

severity


    

status

closed

summary

Add optional start and end parameters to utf8->string and string->utf8.

time

2012-07-15 12:47:53

type

defect

Changes

Change at time 2012-10-07 12:39:38

author

cowan

field

comment

newvalue


    

oldvalue

3

raw-time

1349588378938583

ticket

464

time

2012-10-07 12:39:38

Change at time 2012-10-07 12:39:38

author

cowan

field

resolution

newvalue

fixed

oldvalue


    

raw-time

1349588378938583

ticket

464

time

2012-10-07 12:39:38

Change at time 2012-10-07 12:39:38

author

cowan

field

status

newvalue

closed

oldvalue

writing

raw-time

1349588378938583

ticket

464

time

2012-10-07 12:39:38

Change at time 2012-08-27 04:01:47

author

cowan

field

comment

newvalue


    

oldvalue

2

raw-time

1346014907128695

ticket

464

time

2012-08-27 04:01:47

Change at time 2012-08-27 04:01:47

author

cowan

field

owner

newvalue

cowan

oldvalue

alexshinn

raw-time

1346014907128695

ticket

464

time

2012-08-27 04:01:47

Change at time 2012-08-27 04:01:47

author

cowan

field

status

newvalue

writing

oldvalue

decided

raw-time

1346014907128695

ticket

464

time

2012-08-27 04:01:47

Change at time 2012-08-27 00:51:14

author

cowan

field

comment

newvalue

WG1 voted to adopt this change for both procedures.

oldvalue

1

raw-time

1346003474271769

ticket

464

time

2012-08-27 00:51:14

Change at time 2012-08-27 00:51:14

author

cowan

field

status

newvalue

decided

oldvalue

new

raw-time

1346003474271769

ticket

464

time

2012-08-27 00:51:14