Issue Details (XML | Word | Printable)

Key: SHALE-282
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Craig McClanahan
Reporter: Shinsuke Sugaya
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Shale

ResponseFactory does not support a correct character encoding

Created: 13/Sep/06 07:21 AM   Updated: 23/Jan/07 04:40 PM
Component/s: Remoting
Affects Version/s: 1.0.3
Fix Version/s: 1.0.4

File Attachments:
  Size
Text File Licensed for inclusion in ASF works FixCharsetIssue.patch 2006-09-13 07:22 AM Shinsuke Sugaya 3 kB
Environment: Solaris 10, Java5


 Description  « Hide
I got ? character on "New Style Remoting Support" when I put Japanese resource bundle, Bundle_ja.properties, in usecases sample. The cause seems that ResponseFactory sets null as an encoding of ResponseWriter.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Shinsuke Sugaya added a comment - 13/Sep/06 07:22 AM
Attached patch.

Shinsuke Sugaya made changes - 13/Sep/06 07:22 AM
Field Original Value New Value
Attachment FixCharsetIssue.patch [ 13146 ]
Craig McClanahan made changes - 25/Sep/06 07:28 AM
Assignee Craig McClanahan [ craigmcc ]
Craig McClanahan added a comment - 25/Sep/06 07:32 AM
Sorry for the late response on this ... I've been on the road a lot lately.

I agree that the current behavior (with respect to setting the content type) is broken. However, I have a concern about your patch. Won't the logic for getting the response character encoding from ExternalContext fail on a JSF 1.1 environment, where the method does not exist?

Thinking further about this, it seems that the correct strategy should be to select the character encoding to use by the first match on the following list:

* Character encoding embedded in the contentType that was
  passed to createResponseWriter(), if any.

* Character encoding that has already been set for the response,
  if any.

* Fall back to some reasonable default like UTF-8.

Does that make sense?

Shinsuke Sugaya added a comment - 10/Oct/06 04:42 AM
For ExternalContext#getResponseCharacterEncoding(), yes, it's not supported on JSF 1.1. So, in my patch, the encoding is called by getCharacterEncoding from response object.

For an encoding fallback order, I agree with you.

Repository Revision Date User Message
ASF #476661 Sat Nov 18 23:44:11 UTC 2006 craigmcc Set the response character encoding on the ResponseWriter construted by
ResponseFactory, so that non-ASCII characters may be passed in the content.
Thanks to Shinsuke Sugaya for the patch.

SHALE-282
Files Changed
MODIFY /shale/framework/trunk/shale-apps/shale-usecases/src/main/java/org/apache/shale/usecases/remoting/Business.java
MODIFY /shale/framework/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/BasicResponseWriter.java
MODIFY /shale/framework/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/faces/ResponseFactory.java

Craig McClanahan added a comment - 18/Nov/06 11:45 PM
Fixed in nightly build 20061119, and will be included in 1.0.4. Thanks for the patch!

Craig McClanahan made changes - 18/Nov/06 11:45 PM
Fix Version/s 1.0.4-SNAPSHOT [ 21740 ]
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Rahul Akolkar made changes - 23/Jan/07 04:40 PM
Fix Version/s 1.0.4-SNAPSHOT [ 21740 ]
Fix Version/s 1.0.4 [ 21790 ]
Jeff Turner made changes - 09/Aug/07 07:17 AM
Workflow Struts [ 38722 ] Struts - editable closed status [ 42412 ]
Antonio Petrelli made changes - 08/Jan/09 08:57 AM
Workflow Struts - editable closed status [ 42412 ] Struts - editable closed status (temporary) [ 46308 ]
Antonio Petrelli made changes - 08/Jan/09 09:08 AM
Workflow Struts - editable closed status (temporary) [ 46308 ] Struts - editable closed status [ 52941 ]