Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
I have read the documentation and different postings which state that when sending character data, using the PrintWriter from response.getWriter() is appropriate, and when sending binary data, using the OutputStream from response.getOutputStream should be used. I actually have character data to be sent in the form of a CSV file, and there is a difference in how well Excel handles the file, based on which of the above methods is used. This:
Causes Excel to fail to recognize special characters like the Euro symbol. While this:
Works just fine. I'm all for using the OutputStream, but I would like to know exactly what the nature of the difference is. Is using getWriter causing the container to do some sort of encoding on the content?
public java.io.PrintWriter getWriter() throws java.io.IOException Returns a PrintWriter object that can send character text to the client. The PrintWriter uses the character encoding returned by getCharacterEncoding(). If the response's character encoding has not been specified as described in getCharacterEncoding (i.e., the method just returns the default value ISO-8859-1), getWriter updates it to ISO-8859-1.