You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/12/05 04:46:52 UTC
DO NOT REPLY [Bug 15098] New: -
Enhancement to javadoc for XMLSerializer's Writer-using constructor
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15098>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15098
Enhancement to javadoc for XMLSerializer's Writer-using constructor
Summary: Enhancement to javadoc for XMLSerializer's Writer-using
constructor
Product: Xerces-J
Version: 1.4.4
Platform: All
URL: http://forum.java.sun.com/thread.jsp?forum=34&thread=332
340&tstart=0&trange=15
OS/Version: All
Status: NEW
Severity: Enhancement
Priority: Other
Component: Serialization
AssignedTo: xerces-j-dev@xml.apache.org
ReportedBy: jeff+apache@skubick.com
It's not something that users won't figure out eventually, but it would be
helpful if the Javadoc for XMLSerializer(java.io.Writer writer, OutputFormat
format) were amended to read:
Constructs a new serializer that writes to the specified writer using the
specified output format. If format is null, will use a default output format.
WARNING: FileWriter seems convenient, but it probably *won't* reliably do what
you think it will for this purpose and will likely fail when you least expect
it. Use an OutputStreamWriter explicitly specifying UTF-8 as a Charset
instead.
Example:
// No, no, a billion times NO! --> FileWriter writer = new FileWriter(file);
FileOutputStream outputStream = new FileOutputStream(file);
Charset utf8 = Charset.forName("UTF-8");
OutputStreamWriter writer = new OutputStreamWriter(outputStream, utf8);
XMLSerializer serializer = new XMLSerializer(writer, formatter);
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org