OFBIZ-5929: wrong Chinese text shown after create New Contact Information

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

OFBIZ-5929: wrong Chinese text shown after create New Contact Information

杜 文吉
I also find that ofbiz’s conponent of ecommerce cann’t process japanese properly.

The reason is that httpservletrequest’s mothod setCharacterEncoding is called too late.


The spec of method setCharacterEncoding is writed as follow:

Overrides the name of the character encoding used in the body of this request. This method must be called prior to reading request parameters or reading input using getReader(). Otherwise, it has no effect.


A filer should exist for calling setCharacterEncoding right after http request arrived.

and other setCharacterEncoding’s calls should be deleted.


Windows メール から送信
Reply | Threaded
Open this post in threaded view
|

Re: OFBIZ-5929: wrong Chinese text shown after create New Contact Information

Jacques Le Roux
Administrator
Thanks for report,

I put your message as a comment in the Jira https://issues.apache.org/jira/browse/OFBIZ-5929?focusedCommentId=14306824

Please do so yourself next time (answer in Jira rather than directly to the ML), thanks!

Jacques

Le 27/01/2015 05:20, 杜 文吉 a écrit :

>   also find that ofbiz’s conponent of ecommerce cann’t process japanese properly.
>
> The reason is that httpservletrequest’s mothod setCharacterEncoding is called too late.
>
>
> The spec of method setCharacterEncoding is writed as follow:
>
> Overrides the name of the character encoding used in the body of this request. This method must be called prior to reading request parameters or reading input using getReader(). Otherwise, it has no effect.
>
>
> A filer should exist for calling setCharacterEncoding right after http request arrived.
>
> and other setCharacterEncoding’s calls should be deleted.
>
Reply | Threaded
Open this post in threaded view
|

Re: OFBIZ-5929: wrong Chinese text shown after create New Contact Information

Jacques Le Roux
Administrator
In reply to this post by 杜 文吉
setCharacterEncoding() is only called in

1) ControlServlet.doGet()
Before being called (twice almost at the top) no request parameters or reading through getReader() are done but
request.getCharacterEncoding();
So I see no pb there

2) WebDAv, ResponseHelper.prepareResponse()
I see no pb there as well


2) RequestHandler.renderView()
Indeed here before being called we have this snippet:
         Map<String, Object> paramMap = UtilHttp.getParameterMap(req);
         // add in the attributes as well so everything needed for the rendering context will be in place if/when we get back to this view
         paramMap.putAll(UtilHttp.getAttributeMap(req));
         UtilMisc.makeMapSerializable(paramMap);
the rest before the setCharacterEncoding() call is not concerned (attributes)
I guess it's that you are referring to?

Jacques


Le 27/01/2015 05:20, 杜 文吉 a écrit :

> I also find that ofbiz’s conponent of ecommerce cann’t process japanese properly.
>
> The reason is that httpservletrequest’s mothod setCharacterEncoding is called too late.
>
>
> The spec of method setCharacterEncoding is writed as follow:
>
> Overrides the name of the character encoding used in the body of this request. This method must be called prior to reading request parameters or reading input using getReader(). Otherwise, it has no effect.
>
>
> A filer should exist for calling setCharacterEncoding right after http request arrived.
>
> and other setCharacterEncoding’s calls should be deleted.
>
>
> Windows メール から送信