santuario-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From George Stanchev <Gstanc...@serena.com>
Subject small bug
Date Thu, 12 May 2011 21:58:54 GMT
Hi,

This a small bug I ran into while browsing the source for something else. Not sure if it deserves
a JIRA even (let me know and I will submit one if needed)

In \src\main\java\org\apache\xml\security\utils\XMLUtils.java there is the following snippet:

public static void outputDOM(Node contextNode, OutputStream os,
                                boolean addPreamble) {

      try {
         if (addPreamble) {
            os.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".getBytes());
         }

getBytes() is used which returns the platform encoding but the output XML is specified as
UTF-8. Therefore .getBytes("UTF-8") should be used.

Since this has been in the code forever and encryption or signature nodes are (probably) all
standard 7 bit ASCII, this is not a big deal but it's nice to put the correct code in it when
someone from the devs is doing a commit.

George
Mime
View raw message