Jython

Message3879

Author pjenvey
Recipients pjenvey, zyasoft
Date 2008年12月08日.05:27:14
SpamBayes Score 3.3275123e-06
Marked as misclassified No
Message-id <1228714053.06.0.808589985337.issue1066@psf.upfronthosting.co.za>
In-reply-to
Content
We should utilize the nio charsets for these. One gotcha is they encode 
to/decode from actual bytes, not chars (as they should) -- and of course 
our byte bucket (str) is based on chars.
In that case we could probably make the streaming from/to our 'byte 
bucket' more efficient by faking a ByteBuffer that gave back bytes 
from/put back bytes to an underlying char array. That'd avoid an extra 
conversion pass.
The Encoder/Decoder implementations seem to go through the actual 
ByteBuffer methods -- i.e. not through the underlying Buffer arrays 
directly. That'd allow this hack
A CharsetDecoder can take a ByteBuffer instance to fill into -- we'd 
have to use that for this hack, since Charset.encode returns an entirely 
new ByteBuffer
This hack would be kind of a lame, but would go away in Jython 3. Or we 
could just do the extra pass
Another gotcha would be -- can we still retain our error handling 
behavior with Java's Charsets? Briefly looking at them, they seem to 
have fairly similar error handling facilities
History
Date User Action Args
2008年12月08日 05:27:33pjenveysetmessageid: <1228714053.06.0.808589985337.issue1066@psf.upfronthosting.co.za>
2008年12月08日 05:27:32pjenveysetrecipients: + pjenvey, zyasoft
2008年12月08日 05:27:23pjenveylinkissue1066 messages
2008年12月08日 05:27:18pjenveycreate

Supported by Python Software Foundation,
Powered by Roundup

AltStyle によって変換されたページ (->オリジナル) /