Stream result type doesn't allow to set charset of the response.
Anyway I was getting that response in UTF-8 as defined in my server config. I discovered the problem when set the default locale for my app in struts.properties. After adding "struts.locale=en_GB" I started to get the response of the stream results in ISO-8859-1 but not the data as I could point with Firebug.
Here is the response before adding the struts.locale catched with Firebug:
X-Powered-By Servlet/2.5
Server Sun Java System Application Server 9.1_02
Set-Cookie userLanguage=en_GB; Expires=Mon, 12-Oct-2009 14:25:46 GMT; Path=/
Content-Disposition inline
Content-Type text/plain
Transfer-Encoding chunked
Date Tue, 14 Jul 2009 14:25:47 GMT
The response after adding the struts.locale:
X-Powered-By Servlet/2.5
Server Sun Java System Application Server 9.1_02
Set-Cookie userLanguage=en_GB; Expires=Mon, 12-Oct-2009 14:27:35 GMT; Path=/
Content-Disposition inline
Content-Type text/plain;charset=ISO-8859-1
Content-Language en-GB
Transfer-Encoding chunked
Date Tue, 14 Jul 2009 14:27:37 GMT
I can solve this problem modifying my struts.xml file adding the charset after the contentType in param attribute but I think that's not the better way:
<result type="stream" name="success">
<param name="contentType">text/plain; charset=UTF-8</param>
<param name="inputName">inputStream</param>
</result>
My workmate posted more info about it in the struts2 mail list:
http://www.nabble.com/Stream-Result-and-Japanese-data-getting-corrupted-td22432726.html