From 916e3bf886ee622e2f18d6eb74f90fee8c630471 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 11 Jul 2012 22:54:22 +0100 Subject: Where possible, use the system Encoding.ASCII and Encoding.UTF8 rather than constructing fresh copies. The encodings are thread-safe and already used in such a manner in other places. This isn't done where Byte Order Mark output is suppressed, since Encoding.UTF8 is constructed to output the BOM. --- .../OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs') diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs index 4949097..eaba816 100644 --- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs @@ -425,10 +425,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore try { - System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding(); - string jsondata = SLUtil.ParseNotecardToString(enc.GetString(a.Data)); - int result = m_store.SetValue(storeID,path,jsondata,true) ? 1 : 0; - m_comms.DispatchReply(scriptID,result,"",reqID.ToString()); + string jsondata = SLUtil.ParseNotecardToString(Encoding.UTF8.GetString(a.Data)); + int result = m_store.SetValue(storeID, path, jsondata,true) ? 1 : 0; + m_comms.DispatchReply(scriptID,result, "", reqID.ToString()); return; } catch (Exception e) -- cgit v1.1