diff options
author | Justin Clark-Casey (justincc) | 2012-07-11 22:54:22 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-11 22:54:22 +0100 |
commit | 916e3bf886ee622e2f18d6eb74f90fee8c630471 (patch) | |
tree | 69f9a6d2a7f7041966400f56f46c198f2cc06158 /OpenSim/Region/OptionalModules/Scripting/JsonStore | |
parent | Fix build break for windows with missing package for IScriptEngine in prebuil... (diff) | |
download | opensim-SC-916e3bf886ee622e2f18d6eb74f90fee8c630471.zip opensim-SC-916e3bf886ee622e2f18d6eb74f90fee8c630471.tar.gz opensim-SC-916e3bf886ee622e2f18d6eb74f90fee8c630471.tar.bz2 opensim-SC-916e3bf886ee622e2f18d6eb74f90fee8c630471.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/JsonStore')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs | 7 |
1 files changed, 3 insertions, 4 deletions
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 | |||
425 | 425 | ||
426 | try | 426 | try |
427 | { | 427 | { |
428 | System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding(); | 428 | string jsondata = SLUtil.ParseNotecardToString(Encoding.UTF8.GetString(a.Data)); |
429 | string jsondata = SLUtil.ParseNotecardToString(enc.GetString(a.Data)); | 429 | int result = m_store.SetValue(storeID, path, jsondata,true) ? 1 : 0; |
430 | int result = m_store.SetValue(storeID,path,jsondata,true) ? 1 : 0; | 430 | m_comms.DispatchReply(scriptID,result, "", reqID.ToString()); |
431 | m_comms.DispatchReply(scriptID,result,"",reqID.ToString()); | ||
432 | return; | 431 | return; |
433 | } | 432 | } |
434 | catch (Exception e) | 433 | catch (Exception e) |