From 884d603cac6c3fe0cdbd199e13e1514146ff82bc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Jul 2012 01:03:28 +0100 Subject: Rather than instantiating a UTF8 encoding everywhere when we want to supress the BOM, use a single Util.UTF8NoBomEncoding. This class is thread-safe (as evidenced by the provision of the system-wide Encoding.UTF8 which does not suppress BOM on output). --- .../Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'OpenSim/Server/Handlers/UserAccounts') diff --git a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs index 3fd69ae..72551ef 100644 --- a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs +++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs @@ -195,9 +195,9 @@ namespace OpenSim.Server.Handlers.UserAccounts } string xmlString = ServerUtils.BuildXmlResponse(result); + //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); - UTF8Encoding encoding = new UTF8Encoding(); - return encoding.GetBytes(xmlString); + return Util.UTF8NoBomEncoding.GetBytes(xmlString); } byte[] StoreAccount(Dictionary request) @@ -353,8 +353,7 @@ namespace OpenSim.Server.Handlers.UserAccounts private byte[] ResultToBytes(Dictionary result) { string xmlString = ServerUtils.BuildXmlResponse(result); - UTF8Encoding encoding = new UTF8Encoding(); - return encoding.GetBytes(xmlString); + return Util.UTF8NoBomEncoding.GetBytes(xmlString); } } -} +} \ No newline at end of file -- cgit v1.1