I do not think always passing UTF-8 as character encoding type is right
behavior. As far as I can tell, there is no such requirement to mandate(or
even recommend) UTF-8 as character encoding type in the HTML4
specification (and relevant RFCs). 

 A while ago, I submitted a patch that enables the encoder to take
character encoding name as second parameter. I see no reason why the
character encoding is done with UTF-8. 

Using UTF-8 as character encoding type works only if the  html documents
sent from the application are encoded in UTF-8, but many i18n
applications use 'native' character encodings (like Shift_JIS, Big5,
EUC-KR
etc) instead, for variety of reasons.

  The issue was recently discussed on the mailing list of Japanese
struts user's.  And we found that, for example, html:link tag's
parameter populating functionality has been unusable for many of us
because it ignores the response's character encoding and uses UTF-8 to
get the bytes for url encoding.



> --- Robert Leland <[EMAIL PROTECTED]> wrote:
> > Pierre Maury wrote:
> > The patch would need to be usable with different encoding types.
> 
> Why?  The Java 1.3 version doesn't accept an encoding type and we always
> pass UTF-8 to the 1.4 version.
> 
> > This memory storage seems like a small price to pay for the improvement,
> > but I would like to hear from other commiters.
> 
> I'm not a big fan of this because there are much bigger performance
> optimizations to be had in other layers of a Struts app but I won't stop
> anyone from applying a clear and *tested* optimization.
> 
> David
> 
> > 
> > -Rob
> > 
> > >Hi,
> > >
> > >I think there is a performance issue with
> > >org.apache.struts.taglib.TagUtils.encodeURL(String).
> > >
> > >Attached to this mail, four java classes that demonstrate and solve the
> > >problem. You may run EncoderTest to compare the timings of the original
> > >struts code with a faster encoder.
> > >
> > >On my computer encodeURL takes about 0.2ms. This does not look like a
> > big
> > >issue, but encodeURL is called by computeUrl for each parameter name
> > and
> > >each parameter value. The web site I'm working on displays products
> > lists.
> > >There an average 3 links per product and 20 products per page + 20
> > other
> > >links. Each of this links takes four parameters.
> > >
> > >Total encodeURL time per page amounts to : (3*20+20)*(4*2)*0.2 = 128ms
> > !
> > >At the same time, the struts action + the JSP page takes about 200ms.
> > >
> > >The attached encoder is at least 50 times faster. By using this encoder
> > on
> > >my application, the troughput was greatly improved.
> > >
> > >If you are interrested, I can submit a patch
> > >
> > >
> > >Pierre Maury
> > >  
> > >
> >
> >------------------------------------------------------------------------
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > 
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
> http://companion.yahoo.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-------------------
Yasuhiko Sakakibara
[EMAIL PROTECTED]
[EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to