On Wed, 2013-01-23 at 18:55 +0000, Mark Thomas wrote:
> On 23/01/2013 16:44, Remy Maucherat wrote:
> > Hi,
> > 
> > I have ported a refactoring of character encoding (and decoding) to
> > trunk, using NIO rather than the creative hacks that are used. It makes
> > the IO nice and symmetrical, but I haven't specifically tested any
> > performance (I couldn't stand the old style, so it had to go regardless
> > of the consequences).
> > 
> > See here for what it looks like:
> > http://anonsvn.jboss.org/repos/jbossweb/branches/7.2.x/src/main/java/org/apache/tomcat/util/buf/C2BConverter.java
> > 
> > To use it, there's a number of minor changes scattered in the IO and URI
> > encoding. Should I commit it ?
> 
> I only have a few minor quibbles:
> - The @author tags should be removed in the ASF version
> - s/CodingErrorAction.REPLACE/CodingErrorAction.REPORT/

It's not exactly what I will commit anyway, it's just to give an idea.

About the CodingErrorAction on unmappable, the current (and right)
behavior is (somehow) to replace with '?'. Even on malformed characters,
some people want to replace rather than get an exception (that's
normally also the current behavior) because the data output might come
from user input or someplace similar where it could have funny encoding
(so I was told). Report is the default for both, so there's nothing to
do in that case.

Maybe there could be two configuration options as there's now an
opportunity to fine tune the behavior (there are 3 values: ignore,
report - the default - and replace).

> Overall I like the simplicity. It should be much easier for folks to
> follow (and if it makes NIO easier all the better).

Rémy



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to