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
Return to search
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.

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.

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!