From: Marc Portier

> OK,
> 
> Thx to Carsten's suggestions I have a patch for this that 
> rougly looks like
> 
> 
> 
> 1/ in src/java/org/apache/cocoon/Constants.java
>    . add constant  CONTEXT_DEFAULT_ENCODING
> 
> 
> 2/ in  
> src/java/org/apache/cocoon/serialization/AbstractTextSerializer.java
> 
>    . add imports for Contextualizable
>    . add interface to class declaration
>    . use contextualize method to set default encoding to what 
> is set in 
> the context
>    . note that the configure can still change it depending on the 
> sitemap conf
> 
> 
> 3/ in src/java/org/apache/cocoon/servlet/CocoonServlet.java
> 
>    . in the init() we add the default encoding to the context as read 
> from the servlet-initParameter "form-encoding"
> 
> 
> 
> now, since the last defaults to iso-8859-1 there is a bit of a 
> side-effect to this patch which I introduced in my original posting
> 
> 
> 
> >>> * While at it, shouldn't we kinda default to UTF-8 anyway? even if
> >>> that is not the default encoding of the servlet-container? (some 
> >>> gutfeeling argument: I think cocoon is closer to XML then to 
> >>> servlet-containers?)
> >>>
> 
> if I just apply the patch as described above the side-effect will be 
> that the default-serialization for all our text-serializers (unless 
> overriden by the config in the sitemap.xmap) will change from utf-8 
> (more precisely: whatever xalan defaults to) to iso-8859-1
> 
> 
> maybe that isn't that bad, but just wanted to make you all aware.
> do we need a vote on this, or do I just as I redeem best?

The parameter CONTEXT_DEFAULT_ENCODING is set in Constants.java - how
can I override this value?

> 
> 
> personally I think this patch should come together with a 
> change to our 
> web.xml so we rather change the default form-encoding to be 
> also "utf-8"

sorry, I don't understand this. Does this mean the general encoding is
iso-8859-1 and the form encoding is UTF-8? If yes, why two different
encodings?

Cheers,
Reinhard

Reply via email to