Remy Maucherat wrote:
[EMAIL PROTECTED] wrote:
jfclere 2005/05/04 00:04:30
Modified: catalina/src/share/org/apache/catalina/servlets
DefaultServlet.java
Log:
When the file comes from a resource fileEncoding was not working.
The default beahviour is unchanged: the file is send without a
conversion.
if (cacheEntry.resource != null) {
byte buffer[] = cacheEntry.resource.getContent();
if (buffer != null) {
+ if (fileEncoding != null &&
+ cacheEntry.attributes.getMimeType()!=null &&
+
cacheEntry.attributes.getMimeType().equals("text/html")) {
+ /* the "binary" have to be converted from
fileEncoding to UTF-8 */
+ try {
+ String str = new String(buffer, fileEncoding);
+ buffer = str.getBytes("UTF-8");
+ } catch (Exception e) {
+ }
+ }
ostream.write(buffer, 0, buffer.length);
return;
So, can you revert the patch ? I think that's what we more or less
agreed on, right ?
Done.
Forcing the use of a writer using a getWriter call would likely be more
efficient (much less GC hungry at least).
Rémy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]