mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 20:05:33 +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:
@@ -823,11 +823,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
|
||||
m_log.DebugFormat("[FreeSwitchVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}",
|
||||
landName, land.LocalID, landUUID);
|
||||
}
|
||||
System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
|
||||
|
||||
// slvoice handles the sip address differently if it begins with confctl, hiding it from the user in the friends list. however it also disables
|
||||
// the personal speech indicators as well unless some siren14-3d codec magic happens. we dont have siren143d so we'll settle for the personal speech indicator.
|
||||
channelUri = String.Format("sip:conf-{0}@{1}", "x" + Convert.ToBase64String(encoding.GetBytes(landUUID)), m_freeSwitchRealm);
|
||||
channelUri = String.Format("sip:conf-{0}@{1}", "x" + Convert.ToBase64String(Encoding.ASCII.GetBytes(landUUID)), m_freeSwitchRealm);
|
||||
|
||||
lock (m_ParcelAddress)
|
||||
{
|
||||
|
||||
@@ -1120,7 +1120,6 @@ namespace Nwc.XmlRpc
|
||||
/// <summary>Class supporting the request side of an XML-RPC transaction.</summary>
|
||||
public class ConfigurableKeepAliveXmlRpcRequest : XmlRpcRequest
|
||||
{
|
||||
private Encoding _encoding = new ASCIIEncoding();
|
||||
private XmlRpcRequestSerializer _serializer = new XmlRpcRequestSerializer();
|
||||
private XmlRpcResponseDeserializer _deserializer = new XmlRpcResponseDeserializer();
|
||||
private bool _disableKeepAlive = true;
|
||||
@@ -1153,7 +1152,7 @@ namespace Nwc.XmlRpc
|
||||
request.KeepAlive = !_disableKeepAlive;
|
||||
|
||||
Stream stream = request.GetRequestStream();
|
||||
XmlTextWriter xml = new XmlTextWriter(stream, _encoding);
|
||||
XmlTextWriter xml = new XmlTextWriter(stream, Encoding.ASCII);
|
||||
_serializer.Serialize(xml, this);
|
||||
xml.Flush();
|
||||
xml.Close();
|
||||
|
||||
@@ -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