Hi,

(wicket 1.2.2) If I set
PackagedTextTemplate.setCharset(Charset.forName("utf-8")) the response
length is bad, because the undelying IResourceStream returns length in
'char' unit (StringBuffer.length()), but the
AbstractStringResourceStream.getInputStream() returns the buffer converted
to bytes, which may be longer if there are non-ascii characters in the
buffer. So the response is cut.

Here is (not compilable sample):

PackagedTextTemplate test  = new PackagedTextTemplate(...);
System.out.println("length: " + test.length());// returns
stringBuffer.lenght();
// returns getString().getBytes(getCharset().name()) bytes
int bytes = Streams.copy(test.getInputStream(), new
ByteArrayOutputStream());
System.out.println("bytes: " + bytes);

It seems like a bug, Jan




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to