Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

[ sisc-Bugs-1439761 ] character-set not respected by binary i/o: msg#00018

Subject: [ sisc-Bugs-1439761 ] character-set not respected by binary i/o
Bugs item #1439761, was opened at 2006-02-27 17:04
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=379534&aid=1439761&group_id=23735

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 6
Submitted By: Matthias Radestock (mradestock)
Assigned to: Nobody/Anonymous (nobody)
Summary: character-set not respected by binary i/o

Initial Comment:
I am trying to convert a string to an octet vector,
using different character encodings. To do that I am
using binary i/o backed by buffer:

(import buffers)
(with-character-set "utf-16"
  (lambda ()
    (define (buffer->vector b)make
      (let* ([l (buffer-length b)]
             [v (make-vector l)])
        (do ([i 0 (+ i 1)])
            ((= i l) v)
          (vector-set! v i (buffer-ref b i)))))
    (let ([p (open-output-buffer)])
      (display "F\u00ebo" p)
      (buffer->vector (get-output-buffer p)))))

This should return a vector of size 3 characters x 2
bytes = 6 octets. However, it is actually returning a
vector of size 4 corresponding to the utf-8 encoding.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=379534&aid=1439761&group_id=23735


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642


<Prev in Thread] Current Thread [Next in Thread>