Message3879
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 |
|
Date |
User |
Action |
Args |
2008-12-08 05:27:33 | pjenvey | set | messageid: <1228714053.06.0.808589985337.issue1066@psf.upfronthosting.co.za> |
2008-12-08 05:27:32 | pjenvey | set | recipients:
+ pjenvey, zyasoft |
2008-12-08 05:27:23 | pjenvey | link | issue1066 messages |
2008-12-08 05:27:18 | pjenvey | create | |
|