mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -482,10 +482,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||
// Convert to base64
|
||||
//
|
||||
string filetext = Convert.ToBase64String(data);
|
||||
|
||||
ASCIIEncoding enc = new ASCIIEncoding();
|
||||
|
||||
Byte[] buf = enc.GetBytes(filetext);
|
||||
Byte[] buf = Encoding.ASCII.GetBytes(filetext);
|
||||
|
||||
m_log.Info("MRM 9");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user