Message1694

Author donghp1979
Recipients
Date 2007-07-01.02:47:47
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
iso-8859-1 charset is too simple, maybe convert jarray('b') to error message, examples for socket.py

I think it modified to java.nio.charset.Charset.defaultCharset()

use it maybe righit in most situation!

I found this error using charset 'gbk', chinese~
class PyArray

    ...........
    public String tostring() {
        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        try {
            toStream(bos);
        } catch(IOException e) {
            throw Py.IOError(e);
        }
        try {
            // The returned string is used as a Python str with values
            // from 0-255.  iso-8859-1 maps the byte values into that range.
            return new String(bos.toByteArray(), "iso-8859-1")
        } catch (UnsupportedEncodingException e) {
            throw Py.JavaError(e);
        }
    }
History
Date User Action Args
2008-02-20 17:17:52adminlinkissue1745880 messages
2008-02-20 17:17:52admincreate