aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs4
-rw-r--r--OpenSim/ApplicationPlugins/Rest/RestXmlWriter.cs3
-rw-r--r--OpenSim/Client/MXP/ClientStack/MXPClientView.cs2
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs14
-rw-r--r--OpenSim/Framework/AssetLandmark.cs2
-rw-r--r--OpenSim/Framework/Capabilities/LLSD.cs4
-rw-r--r--OpenSim/Framework/Capabilities/LLSDStreamHandler.cs2
-rw-r--r--OpenSim/Framework/Communications/XMPP/XmppWriter.cs2
-rw-r--r--OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs2
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs2
-rw-r--r--OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs23
-rw-r--r--OpenSim/Framework/Util.cs10
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs6
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs4
-rw-r--r--OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs4
-rw-r--r--OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs10
-rw-r--r--OpenSim/Region/DataSnapshot/DataSnapshotManager.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/TerrainChannel.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs4
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs4
-rw-r--r--OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs2
-rw-r--r--OpenSim/Server/Base/ServerUtils.cs2
-rw-r--r--OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs2
-rw-r--r--OpenSim/Server/Handlers/Simulation/AgentHandlers.cs2
28 files changed, 73 insertions, 51 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs
index 1e3539f..7db705e 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs
@@ -163,7 +163,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
163 get { return Plugin.RequestId; } 163 get { return Plugin.RequestId; }
164 } 164 }
165 165
166 internal static Encoding Encoding = Encoding.UTF8; 166 internal static Encoding Encoding = Util.UTF8;
167 167
168 /// <summary> 168 /// <summary>
169 /// Version control for REST implementation. This 169 /// Version control for REST implementation. This
@@ -435,7 +435,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
435 try 435 try
436 { 436 {
437 byte[] encData_byte = new byte[str.Length]; 437 byte[] encData_byte = new byte[str.Length];
438 encData_byte = Encoding.UTF8.GetBytes(str); 438 encData_byte = Util.UTF8.GetBytes(str);
439 return Convert.ToBase64String(encData_byte); 439 return Convert.ToBase64String(encData_byte);
440 } 440 }
441 catch 441 catch
diff --git a/OpenSim/ApplicationPlugins/Rest/RestXmlWriter.cs b/OpenSim/ApplicationPlugins/Rest/RestXmlWriter.cs
index 9abb0c8..283fa2e 100644
--- a/OpenSim/ApplicationPlugins/Rest/RestXmlWriter.cs
+++ b/OpenSim/ApplicationPlugins/Rest/RestXmlWriter.cs
@@ -45,7 +45,8 @@ namespace OpenSim.ApplicationPlugins.Rest
45 { 45 {
46 } 46 }
47 47
48 public RestXmlWriter(Stream stream) : this(stream, Encoding.UTF8) 48 public RestXmlWriter(Stream stream)
49 : this(stream, Encoding.UTF8)
49 { 50 {
50 } 51 }
51 52
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
index e901ff6..bc1b2e5 100644
--- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
+++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
@@ -886,7 +886,7 @@ namespace OpenSim.Client.MXP.ClientStack
886 chatActionEvent.ActionFragment.SourceObjectId = fromAgentID.Guid; 886 chatActionEvent.ActionFragment.SourceObjectId = fromAgentID.Guid;
887 chatActionEvent.ActionFragment.ObservationRadius = 180.0f; 887 chatActionEvent.ActionFragment.ObservationRadius = 180.0f;
888 chatActionEvent.ActionFragment.ExtensionDialect = "TEXT"; 888 chatActionEvent.ActionFragment.ExtensionDialect = "TEXT";
889 chatActionEvent.SetPayloadData(Encoding.UTF8.GetBytes(message)); 889 chatActionEvent.SetPayloadData(Util.UTF8.GetBytes(message));
890 890
891 Session.Send(chatActionEvent); 891 Session.Send(chatActionEvent);
892 } 892 }
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index 1d17bb9..08af7c3 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -581,13 +581,17 @@ namespace OpenSim.Data.SQLite
581 if (row.Read()) 581 if (row.Read())
582 { 582 {
583 // TODO: put this into a function 583 // TODO: put this into a function
584 MemoryStream str = new MemoryStream((byte[]) row["Heightfield"]); 584 using (MemoryStream str = new MemoryStream((byte[])row["Heightfield"]))
585 BinaryReader br = new BinaryReader(str);
586 for (int x = 0; x < (int)Constants.RegionSize; x++)
587 { 585 {
588 for (int y = 0; y < (int)Constants.RegionSize; y++) 586 using (BinaryReader br = new BinaryReader(str))
589 { 587 {
590 terret[x, y] = br.ReadDouble(); 588 for (int x = 0; x < (int)Constants.RegionSize; x++)
589 {
590 for (int y = 0; y < (int)Constants.RegionSize; y++)
591 {
592 terret[x, y] = br.ReadDouble();
593 }
594 }
591 } 595 }
592 } 596 }
593 rev = (int) row["Revision"]; 597 rev = (int) row["Revision"];
diff --git a/OpenSim/Framework/AssetLandmark.cs b/OpenSim/Framework/AssetLandmark.cs
index 7c87c34..fd7a2cd 100644
--- a/OpenSim/Framework/AssetLandmark.cs
+++ b/OpenSim/Framework/AssetLandmark.cs
@@ -49,7 +49,7 @@ namespace OpenSim.Framework
49 49
50 private void InternData() 50 private void InternData()
51 { 51 {
52 string temp = Encoding.UTF8.GetString(Data).Trim(); 52 string temp = Util.UTF8.GetString(Data).Trim();
53 string[] parts = temp.Split('\n'); 53 string[] parts = temp.Split('\n');
54 int.TryParse(parts[0].Substring(17, 1), out Version); 54 int.TryParse(parts[0].Substring(17, 1), out Version);
55 UUID.TryParse(parts[1].Substring(10, 36), out RegionID); 55 UUID.TryParse(parts[1].Substring(10, 36), out RegionID);
diff --git a/OpenSim/Framework/Capabilities/LLSD.cs b/OpenSim/Framework/Capabilities/LLSD.cs
index 84f43c1..eec9e61 100644
--- a/OpenSim/Framework/Capabilities/LLSD.cs
+++ b/OpenSim/Framework/Capabilities/LLSD.cs
@@ -112,7 +112,7 @@ namespace OpenSim.Framework.Capabilities
112 112
113 writer.Close(); 113 writer.Close();
114 114
115 return Encoding.UTF8.GetBytes(sw.ToString()); 115 return Util.UTF8.GetBytes(sw.ToString());
116 } 116 }
117 117
118 /// <summary> 118 /// <summary>
@@ -329,7 +329,7 @@ namespace OpenSim.Framework.Capabilities
329 329
330 reader.Read(); 330 reader.Read();
331 FromBase64Transform b64 = new FromBase64Transform(FromBase64TransformMode.IgnoreWhiteSpaces); 331 FromBase64Transform b64 = new FromBase64Transform(FromBase64TransformMode.IgnoreWhiteSpaces);
332 byte[] inp = Encoding.UTF8.GetBytes(reader.ReadString()); 332 byte[] inp = Util.UTF8.GetBytes(reader.ReadString());
333 ret = b64.TransformFinalBlock(inp, 0, inp.Length); 333 ret = b64.TransformFinalBlock(inp, 0, inp.Length);
334 break; 334 break;
335 } 335 }
diff --git a/OpenSim/Framework/Capabilities/LLSDStreamHandler.cs b/OpenSim/Framework/Capabilities/LLSDStreamHandler.cs
index df48b35..7aaa994 100644
--- a/OpenSim/Framework/Capabilities/LLSDStreamHandler.cs
+++ b/OpenSim/Framework/Capabilities/LLSDStreamHandler.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Framework.Capabilities
47 public override byte[] Handle(string path, Stream request, 47 public override byte[] Handle(string path, Stream request,
48 OSHttpRequest httpRequest, OSHttpResponse httpResponse) 48 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
49 { 49 {
50 //Encoding encoding = Encoding.UTF8; 50 //Encoding encoding = Util.UTF8;
51 //StreamReader streamReader = new StreamReader(request, false); 51 //StreamReader streamReader = new StreamReader(request, false);
52 52
53 //string requestBody = streamReader.ReadToEnd(); 53 //string requestBody = streamReader.ReadToEnd();
diff --git a/OpenSim/Framework/Communications/XMPP/XmppWriter.cs b/OpenSim/Framework/Communications/XMPP/XmppWriter.cs
index b52eda7..415d808 100644
--- a/OpenSim/Framework/Communications/XMPP/XmppWriter.cs
+++ b/OpenSim/Framework/Communications/XMPP/XmppWriter.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Framework.Communications.XMPP
38 { 38 {
39 } 39 }
40 40
41 public XMPPWriter(IOStream stream) : this(stream, Encoding.UTF8) 41 public XMPPWriter(IOStream stream) : this(stream, Util.UTF8)
42 { 42 {
43 } 43 }
44 44
diff --git a/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs
index 318d2c3..3dce578 100644
--- a/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs
+++ b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs
@@ -77,7 +77,7 @@ namespace OpenSim.Framework.Configuration.HTTP
77 count = resStream.Read(buf, 0, buf.Length); 77 count = resStream.Read(buf, 0, buf.Length);
78 if (count != 0) 78 if (count != 0)
79 { 79 {
80 tempString = Encoding.UTF8.GetString(buf, 0, count); 80 tempString = Util.UTF8.GetString(buf, 0, count);
81 sb.Append(tempString); 81 sb.Append(tempString);
82 } 82 }
83 } while (count > 0); 83 } while (count > 0);
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
index 6c63c6c..942fed9 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -979,7 +979,7 @@ namespace OpenSim.Framework.Servers.HttpServer
979 } 979 }
980 980
981 // response.ContentType = "application/llsd+json"; 981 // response.ContentType = "application/llsd+json";
982 // return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse)); 982 // return Util.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse));
983 response.ContentType = "application/llsd+xml"; 983 response.ContentType = "application/llsd+xml";
984 return OSDParser.SerializeLLSDXmlBytes(llsdResponse); 984 return OSDParser.SerializeLLSDXmlBytes(llsdResponse);
985 } 985 }
diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs
index ec9bd4f..eab463c 100644
--- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs
+++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestObjectRequester.cs
@@ -58,6 +58,7 @@ namespace OpenSim.Framework.Servers.HttpServer
58 public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj) 58 public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
59 { 59 {
60 Type type = typeof (TRequest); 60 Type type = typeof (TRequest);
61 TResponse deserial = default(TResponse);
61 62
62 WebRequest request = WebRequest.Create(requestUrl); 63 WebRequest request = WebRequest.Create(requestUrl);
63 request.Method = verb; 64 request.Method = verb;
@@ -81,19 +82,33 @@ namespace OpenSim.Framework.Servers.HttpServer
81 int length = (int) buffer.Length; 82 int length = (int) buffer.Length;
82 request.ContentLength = length; 83 request.ContentLength = length;
83 84
84 Stream requestStream = request.GetRequestStream(); 85 Stream requestStream = null;
85 requestStream.Write(buffer.ToArray(), 0, length); 86 try
87 {
88 requestStream = request.GetRequestStream();
89 requestStream.Write(buffer.ToArray(), 0, length);
90 }
91 catch (Exception)
92 {
93 return deserial;
94 }
95 finally
96 {
97 if (requestStream != null)
98 requestStream.Close();
99 }
86 } 100 }
87 101
88 TResponse deserial = default(TResponse);
89 try 102 try
90 { 103 {
91 using (WebResponse resp = request.GetResponse()) 104 using (WebResponse resp = request.GetResponse())
92 { 105 {
93 if (resp.ContentLength > 0) 106 if (resp.ContentLength > 0)
94 { 107 {
108 Stream respStream = resp.GetResponseStream();
95 XmlSerializer deserializer = new XmlSerializer(typeof(TResponse)); 109 XmlSerializer deserializer = new XmlSerializer(typeof(TResponse));
96 deserial = (TResponse)deserializer.Deserialize(resp.GetResponseStream()); 110 deserial = (TResponse)deserializer.Deserialize(respStream);
111 respStream.Close();
97 } 112 }
98 } 113 }
99 } 114 }
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 17fc58c..0851d26 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -103,6 +103,8 @@ namespace OpenSim.Framework
103 } 103 }
104 104
105 105
106 public static Encoding UTF8 = Encoding.UTF8;
107
106 /// <value> 108 /// <value>
107 /// Well known UUID for the blank texture used in the Linden SL viewer version 1.20 (and hopefully onwards) 109 /// Well known UUID for the blank texture used in the Linden SL viewer version 1.20 (and hopefully onwards)
108 /// </value> 110 /// </value>
@@ -465,7 +467,7 @@ namespace OpenSim.Framework
465 output.Append(": "); 467 output.Append(": ");
466 } 468 }
467 469
468 output.Append(CleanString(Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1))); 470 output.Append(CleanString(Util.UTF8.GetString(bytes, 0, bytes.Length - 1)));
469 } 471 }
470 else 472 else
471 { 473 {
@@ -826,7 +828,7 @@ namespace OpenSim.Framework
826 828
827 public static string Compress(string text) 829 public static string Compress(string text)
828 { 830 {
829 byte[] buffer = Encoding.UTF8.GetBytes(text); 831 byte[] buffer = Util.UTF8.GetBytes(text);
830 MemoryStream memory = new MemoryStream(); 832 MemoryStream memory = new MemoryStream();
831 using (GZipStream compressor = new GZipStream(memory, CompressionMode.Compress, true)) 833 using (GZipStream compressor = new GZipStream(memory, CompressionMode.Compress, true))
832 { 834 {
@@ -860,7 +862,7 @@ namespace OpenSim.Framework
860 decompressor.Read(buffer, 0, buffer.Length); 862 decompressor.Read(buffer, 0, buffer.Length);
861 } 863 }
862 864
863 return Encoding.UTF8.GetString(buffer); 865 return Util.UTF8.GetString(buffer);
864 } 866 }
865 } 867 }
866 868
@@ -1132,7 +1134,7 @@ namespace OpenSim.Framework
1132 { 1134 {
1133 byte[] data = new byte[length]; 1135 byte[] data = new byte[length];
1134 stream.Read(data, 0, length); 1136 stream.Read(data, 0, length);
1135 string strdata = Encoding.UTF8.GetString(data); 1137 string strdata = Util.UTF8.GetString(data);
1136 OSDMap args = null; 1138 OSDMap args = null;
1137 OSD buffer; 1139 OSD buffer;
1138 buffer = OSDParser.DeserializeJson(strdata); 1140 buffer = OSDParser.DeserializeJson(strdata);
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 468c5d7..6e7a2a0 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -699,7 +699,7 @@ namespace OpenSim
699 public byte[] Handle(string path, Stream request, 699 public byte[] Handle(string path, Stream request,
700 OSHttpRequest httpRequest, OSHttpResponse httpResponse) 700 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
701 { 701 {
702 return Encoding.UTF8.GetBytes("OK"); 702 return Util.UTF8.GetBytes("OK");
703 } 703 }
704 704
705 public string ContentType 705 public string ContentType
@@ -736,7 +736,7 @@ namespace OpenSim
736 public byte[] Handle(string path, Stream request, 736 public byte[] Handle(string path, Stream request,
737 OSHttpRequest httpRequest, OSHttpResponse httpResponse) 737 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
738 { 738 {
739 return Encoding.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); 739 return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest));
740 } 740 }
741 741
742 public string ContentType 742 public string ContentType
@@ -777,7 +777,7 @@ namespace OpenSim
777 public byte[] Handle(string path, Stream request, 777 public byte[] Handle(string path, Stream request,
778 OSHttpRequest httpRequest, OSHttpResponse httpResponse) 778 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
779 { 779 {
780 return Encoding.UTF8.GetBytes(m_opensim.StatReport(httpRequest)); 780 return Util.UTF8.GetBytes(m_opensim.StatReport(httpRequest));
781 } 781 }
782 782
783 public string ContentType 783 public string ContentType
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 3b43771..0052729 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -4751,7 +4751,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4751 { 4751 {
4752 Hashtable mp = (Hashtable)simMapProfiles[iii]; 4752 Hashtable mp = (Hashtable)simMapProfiles[iii];
4753 mbReply.Data[iii] = new MapBlockReplyPacket.DataBlock(); 4753 mbReply.Data[iii] = new MapBlockReplyPacket.DataBlock();
4754 mbReply.Data[iii].Name = System.Text.Encoding.UTF8.GetBytes((string)mp["name"]); 4754 mbReply.Data[iii].Name = Util.UTF8.GetBytes((string)mp["name"]);
4755 mbReply.Data[iii].Access = System.Convert.ToByte(mp["access"]); 4755 mbReply.Data[iii].Access = System.Convert.ToByte(mp["access"]);
4756 mbReply.Data[iii].Agents = System.Convert.ToByte(mp["agents"]); 4756 mbReply.Data[iii].Agents = System.Convert.ToByte(mp["agents"]);
4757 mbReply.Data[iii].MapImageID = new UUID((string)mp["map-image-id"]); 4757 mbReply.Data[iii].MapImageID = new UUID((string)mp["map-image-id"]);
@@ -7341,7 +7341,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7341 } 7341 }
7342 #endregion 7342 #endregion
7343 7343
7344 string mapName = Encoding.UTF8.GetString(map.NameData.Name, 0, 7344 string mapName = Util.UTF8.GetString(map.NameData.Name, 0,
7345 map.NameData.Name.Length - 1); 7345 map.NameData.Name.Length - 1);
7346 handlerMapNameRequest = OnMapNameRequest; 7346 handlerMapNameRequest = OnMapNameRequest;
7347 if (handlerMapNameRequest != null) 7347 if (handlerMapNameRequest != null)
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
index a0f359b..7456e8c 100644
--- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
@@ -257,7 +257,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
257 stringResult.AppendFormat("{0}|{1}|{2}{3}", Layers[i].Start, Layers[i].End, Layers[i].End - Layers[i].Start, strEnd); 257 stringResult.AppendFormat("{0}|{1}|{2}{3}", Layers[i].Start, Layers[i].End, Layers[i].End - Layers[i].Start, strEnd);
258 } 258 }
259 259
260 layerDecodeAsset.Data = Encoding.UTF8.GetBytes(stringResult.ToString()); 260 layerDecodeAsset.Data = Util.UTF8.GetBytes(stringResult.ToString());
261 261
262 #endregion Serialize Layer Data 262 #endregion Serialize Layer Data
263 263
@@ -280,7 +280,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
280 { 280 {
281 #region Deserialize Layer Data 281 #region Deserialize Layer Data
282 282
283 string readResult = Encoding.UTF8.GetString(layerDecodeAsset.Data); 283 string readResult = Util.UTF8.GetString(layerDecodeAsset.Data);
284 string[] lines = readResult.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries); 284 string[] lines = readResult.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
285 285
286 if (lines.Length == 0) 286 if (lines.Length == 0)
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
index 50d7c97..45e724d 100644
--- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -367,7 +367,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
367 // Encode outbound data 367 // Encode outbound data
368 if (OutboundBody.Length > 0) 368 if (OutboundBody.Length > 0)
369 { 369 {
370 byte[] data = Encoding.UTF8.GetBytes(OutboundBody); 370 byte[] data = Util.UTF8.GetBytes(OutboundBody);
371 371
372 Request.ContentLength = data.Length; 372 Request.ContentLength = data.Length;
373 Stream bstream = Request.GetRequestStream(); 373 Stream bstream = Request.GetRequestStream();
@@ -390,7 +390,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
390 if (count != 0) 390 if (count != 0)
391 { 391 {
392 // translate from bytes to ASCII text 392 // translate from bytes to ASCII text
393 tempString = Encoding.UTF8.GetString(buf, 0, count); 393 tempString = Util.UTF8.GetString(buf, 0, count);
394 394
395 // continue building the string 395 // continue building the string
396 sb.Append(tempString); 396 sb.Append(tempString);
diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs
index 3eb7cd2..a70ef13 100644
--- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs
+++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs
@@ -36,10 +36,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
36 { 36 {
37 public struct HeightmapLookupValue : IComparable<HeightmapLookupValue> 37 public struct HeightmapLookupValue : IComparable<HeightmapLookupValue>
38 { 38 {
39 public int Index; 39 public ushort Index;
40 public double Value; 40 public float Value;
41 41
42 public HeightmapLookupValue(int index, double value) 42 public HeightmapLookupValue(ushort index, float value)
43 { 43 {
44 Index = index; 44 Index = index;
45 Value = value; 45 Value = value;
@@ -62,7 +62,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
62 { 62 {
63 for (int j = 0; j < 256; j++) 63 for (int j = 0; j < 256; j++)
64 { 64 {
65 LookupHeightTable[i + (j * 256)] = new HeightmapLookupValue(i + (j * 256), ((double)i * ((double)j / 128.0d))); 65 LookupHeightTable[i + (j * 256)] = new HeightmapLookupValue((ushort)(i + (j * 256)), (float)((double)i * ((double)j / 128.0d)));
66 } 66 }
67 } 67 }
68 Array.Sort<HeightmapLookupValue>(LookupHeightTable); 68 Array.Sort<HeightmapLookupValue>(LookupHeightTable);
@@ -196,7 +196,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders
196 196
197 // The lookup table is pre-sorted, so we either find an exact match or 197 // The lookup table is pre-sorted, so we either find an exact match or
198 // the next closest (smaller) match with a binary search 198 // the next closest (smaller) match with a binary search
199 index = Array.BinarySearch<HeightmapLookupValue>(LookupHeightTable, new HeightmapLookupValue(0, t)); 199 index = Array.BinarySearch<HeightmapLookupValue>(LookupHeightTable, new HeightmapLookupValue(0, (float)t));
200 if (index < 0) 200 if (index < 0)
201 index = ~index - 1; 201 index = ~index - 1;
202 202
diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
index 080bd5a..4df9094 100644
--- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
+++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
@@ -352,7 +352,7 @@ namespace OpenSim.Region.DataSnapshot
352 m_log.WarnFormat("[DATASNAPSHOT]: Unable to decode reply from data service. Ignoring. {0}", e.StackTrace); 352 m_log.WarnFormat("[DATASNAPSHOT]: Unable to decode reply from data service. Ignoring. {0}", e.StackTrace);
353 } 353 }
354 // This is not quite working, so... 354 // This is not quite working, so...
355 // string responseStr = Encoding.UTF8.GetString(response); 355 // string responseStr = Util.UTF8.GetString(response);
356 m_log.Info("[DATASNAPSHOT]: data service notified: " + url); 356 m_log.Info("[DATASNAPSHOT]: data service notified: " + url);
357 } 357 }
358 358
diff --git a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
index 73f918e..e9660b1 100644
--- a/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
+++ b/OpenSim/Region/Framework/Scenes/RegionStatsHandler.cs
@@ -73,7 +73,7 @@ namespace OpenSim.Region.Framework.Scenes
73 73
74 public byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse) 74 public byte[] Handle(string path, Stream request, OSHttpRequest httpRequest, OSHttpResponse httpResponse)
75 { 75 {
76 return Encoding.UTF8.GetBytes(Report()); 76 return Util.UTF8.GetBytes(Report());
77 } 77 }
78 78
79 public string ContentType 79 public string ContentType
diff --git a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs
index 8209ff6..ca6210d 100644
--- a/OpenSim/Region/Framework/Scenes/TerrainChannel.cs
+++ b/OpenSim/Region/Framework/Scenes/TerrainChannel.cs
@@ -172,7 +172,7 @@ namespace OpenSim.Region.Framework.Scenes
172 public string SaveToXmlString() 172 public string SaveToXmlString()
173 { 173 {
174 XmlWriterSettings settings = new XmlWriterSettings(); 174 XmlWriterSettings settings = new XmlWriterSettings();
175 settings.Encoding = Encoding.UTF8; 175 settings.Encoding = Util.UTF8;
176 using (StringWriter sw = new StringWriter()) 176 using (StringWriter sw = new StringWriter())
177 { 177 {
178 using (XmlWriter writer = XmlWriter.Create(sw, settings)) 178 using (XmlWriter writer = XmlWriter.Create(sw, settings))
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index ee2d2db..4364627 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -81,7 +81,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
81 { 81 {
82 m_log.Info("[IRCd] Sending >>> " + command); 82 m_log.Info("[IRCd] Sending >>> " + command);
83 83
84 byte[] buf = Encoding.UTF8.GetBytes(command + "\r\n"); 84 byte[] buf = Util.UTF8.GetBytes(command + "\r\n");
85 85
86 m_client.GetStream().BeginWrite(buf, 0, buf.Length, SendComplete, null); 86 m_client.GetStream().BeginWrite(buf, 0, buf.Length, SendComplete, null);
87 } 87 }
@@ -109,7 +109,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
109 byte[] buf = new byte[8]; // RFC1459 defines max message size as 512. 109 byte[] buf = new byte[8]; // RFC1459 defines max message size as 512.
110 110
111 int count = m_client.GetStream().Read(buf, 0, buf.Length); 111 int count = m_client.GetStream().Read(buf, 0, buf.Length);
112 string line = Encoding.UTF8.GetString(buf, 0, count); 112 string line = Util.UTF8.GetString(buf, 0, count);
113 113
114 strbuf += line; 114 strbuf += line;
115 115
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index c7bb56a..b04b076 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -559,7 +559,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
559 559
560 if (method == "POST") 560 if (method == "POST")
561 { 561 {
562 byte[] contentreq = Encoding.UTF8.GetBytes(body); 562 byte[] contentreq = Util.UTF8.GetBytes(body);
563 forwardreq.ContentLength = contentreq.Length; 563 forwardreq.ContentLength = contentreq.Length;
564 Stream reqStream = forwardreq.GetRequestStream(); 564 Stream reqStream = forwardreq.GetRequestStream();
565 reqStream.Write(contentreq, 0, contentreq.Length); 565 reqStream.Write(contentreq, 0, contentreq.Length);
@@ -567,7 +567,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
567 } 567 }
568 568
569 HttpWebResponse fwdrsp = (HttpWebResponse)forwardreq.GetResponse(); 569 HttpWebResponse fwdrsp = (HttpWebResponse)forwardreq.GetResponse();
570 Encoding encoding = Encoding.UTF8; 570 Encoding encoding = Util.UTF8;
571 StreamReader fwdresponsestream = new StreamReader(fwdrsp.GetResponseStream(), encoding); 571 StreamReader fwdresponsestream = new StreamReader(fwdrsp.GetResponseStream(), encoding);
572 fwdresponsestr = fwdresponsestream.ReadToEnd(); 572 fwdresponsestr = fwdresponsestream.ReadToEnd();
573 fwdresponsecontenttype = fwdrsp.ContentType; 573 fwdresponsecontenttype = fwdrsp.ContentType;
diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
index 3044b17..e3fbb6e 100644
--- a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
+++ b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
@@ -539,7 +539,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
539 { 539 {
540 XmlSerializer xs = new XmlSerializer(typeof(Copse)); 540 XmlSerializer xs = new XmlSerializer(typeof(Copse));
541 541
542 using (XmlTextWriter writer = new XmlTextWriter(fileName, System.Text.Encoding.UTF8)) 542 using (XmlTextWriter writer = new XmlTextWriter(fileName, Util.UTF8))
543 { 543 {
544 writer.Formatting = Formatting.Indented; 544 writer.Formatting = Formatting.Indented;
545 xs.Serialize(writer, obj); 545 xs.Serialize(writer, obj);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index cb91677..b5f6721 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -7077,7 +7077,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7077 try 7077 try
7078 { 7078 {
7079 byte[] encData_byte = new byte[str.Length]; 7079 byte[] encData_byte = new byte[str.Length];
7080 encData_byte = Encoding.UTF8.GetBytes(str); 7080 encData_byte = Util.UTF8.GetBytes(str);
7081 string encodedData = Convert.ToBase64String(encData_byte); 7081 string encodedData = Convert.ToBase64String(encData_byte);
7082 return encodedData; 7082 return encodedData;
7083 } 7083 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 59525b6..4cb4b61 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -1491,7 +1491,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1491 notecardData = "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length " 1491 notecardData = "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length "
1492 + textLength.ToString() + "\n" + notecardData + "}\n"; 1492 + textLength.ToString() + "\n" + notecardData + "}\n";
1493 1493
1494 asset.Data = Encoding.UTF8.GetBytes(notecardData); 1494 asset.Data = Util.UTF8.GetBytes(notecardData);
1495 World.AssetService.Store(asset); 1495 World.AssetService.Store(asset);
1496 1496
1497 // Create Task Entry 1497 // Create Task Entry
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index 9beadd8..0964caa 100644
--- a/OpenSim/Server/Base/ServerUtils.cs
+++ b/OpenSim/Server/Base/ServerUtils.cs
@@ -87,7 +87,7 @@ namespace OpenSim.Server.Base
87 public static byte[] SerializeResult(XmlSerializer xs, object data) 87 public static byte[] SerializeResult(XmlSerializer xs, object data)
88 { 88 {
89 MemoryStream ms = new MemoryStream(); 89 MemoryStream ms = new MemoryStream();
90 XmlTextWriter xw = new XmlTextWriter(ms, Encoding.UTF8); 90 XmlTextWriter xw = new XmlTextWriter(ms, Util.UTF8);
91 xw.Formatting = Formatting.Indented; 91 xw.Formatting = Formatting.Indented;
92 xs.Serialize(xw, data); 92 xs.Serialize(xw, data);
93 xw.Flush(); 93 xw.Flush();
diff --git a/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs b/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs
index d6ef22e..68bb01e 100644
--- a/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs
+++ b/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs
@@ -160,7 +160,7 @@ namespace OpenSim.Server.Handlers.Neighbour
160 160
161 httpResponse.StatusCode = (int)HttpStatusCode.OK; 161 httpResponse.StatusCode = (int)HttpStatusCode.OK;
162 162
163 return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(resp)); 163 return Util.UTF8.GetBytes(OSDParser.SerializeJsonString(resp));
164 } 164 }
165 } 165 }
166 166
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 822edcb..3da72c7 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -161,7 +161,7 @@ namespace OpenSim.Server.Handlers.Simulation
161 161
162 httpResponse.StatusCode = (int)HttpStatusCode.OK; 162 httpResponse.StatusCode = (int)HttpStatusCode.OK;
163 163
164 return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(resp)); 164 return Util.UTF8.GetBytes(OSDParser.SerializeJsonString(resp));
165 } 165 }
166 } 166 }
167 167