aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJohn Hurliman2009-10-02 18:31:08 -0700
committerJohn Hurliman2009-10-02 18:31:08 -0700
commit387e9f7a7faeb412054383080afc3507a1522746 (patch)
tree522470dd28074f7e114547476968942c05e866aa /OpenSim
parentMerge branch 'diva-textures-osgrid' of ssh://opensimulator.org/var/git/opensi... (diff)
downloadopensim-SC-387e9f7a7faeb412054383080afc3507a1522746.zip
opensim-SC-387e9f7a7faeb412054383080afc3507a1522746.tar.gz
opensim-SC-387e9f7a7faeb412054383080afc3507a1522746.tar.bz2
opensim-SC-387e9f7a7faeb412054383080afc3507a1522746.tar.xz
* Creates Util.UTF8 and switches some references of Encoding.UTF8 to Util.UTF8 (not all references were switched since not all OpenSim libraries reference OpenSim.Framework)
* Shrinks the largest in-memory object, the LLRAW.HeightmapLookupValue struct (only used for exporting to LLRAW terrain files), to the minimum possible size. This seems to have the odd side effect of cutting the size of the two double[256,256] terrain objects in half. Possibly an alignment optimization?
Diffstat (limited to 'OpenSim')
-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/Util.cs12
-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
27 files changed, 55 insertions, 48 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 180f5e0..603ef57 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 ea076fe..a3ae6ea 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 771ae05..f314d64 100644
--- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
+++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs
@@ -965,7 +965,7 @@ namespace OpenSim.Framework.Servers.HttpServer
965 } 965 }
966 966
967 // response.ContentType = "application/llsd+json"; 967 // response.ContentType = "application/llsd+json";
968 // return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse)); 968 // return Util.UTF8.GetBytes(OSDParser.SerializeJsonString(llsdResponse));
969 response.ContentType = "application/llsd+xml"; 969 response.ContentType = "application/llsd+xml";
970 return OSDParser.SerializeLLSDXmlBytes(llsdResponse); 970 return OSDParser.SerializeLLSDXmlBytes(llsdResponse);
971 } 971 }
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 58344f3..59159a8 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -69,7 +69,9 @@ namespace OpenSim.Framework
69 69
70 public static readonly Regex UUIDPattern 70 public static readonly Regex UUIDPattern
71 = new Regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"); 71 = new Regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$");
72 72
73 public static Encoding UTF8 = Encoding.UTF8;
74
73 /// <value> 75 /// <value>
74 /// Well known UUID for the blank texture used in the Linden SL viewer version 1.20 (and hopefully onwards) 76 /// Well known UUID for the blank texture used in the Linden SL viewer version 1.20 (and hopefully onwards)
75 /// </value> 77 /// </value>
@@ -432,7 +434,7 @@ namespace OpenSim.Framework
432 output.Append(": "); 434 output.Append(": ");
433 } 435 }
434 436
435 output.Append(CleanString(Encoding.UTF8.GetString(bytes, 0, bytes.Length - 1))); 437 output.Append(CleanString(Util.UTF8.GetString(bytes, 0, bytes.Length - 1)));
436 } 438 }
437 else 439 else
438 { 440 {
@@ -793,7 +795,7 @@ namespace OpenSim.Framework
793 795
794 public static string Compress(string text) 796 public static string Compress(string text)
795 { 797 {
796 byte[] buffer = Encoding.UTF8.GetBytes(text); 798 byte[] buffer = Util.UTF8.GetBytes(text);
797 MemoryStream memory = new MemoryStream(); 799 MemoryStream memory = new MemoryStream();
798 using (GZipStream compressor = new GZipStream(memory, CompressionMode.Compress, true)) 800 using (GZipStream compressor = new GZipStream(memory, CompressionMode.Compress, true))
799 { 801 {
@@ -827,7 +829,7 @@ namespace OpenSim.Framework
827 decompressor.Read(buffer, 0, buffer.Length); 829 decompressor.Read(buffer, 0, buffer.Length);
828 } 830 }
829 831
830 return Encoding.UTF8.GetString(buffer); 832 return Util.UTF8.GetString(buffer);
831 } 833 }
832 } 834 }
833 835
@@ -1099,7 +1101,7 @@ namespace OpenSim.Framework
1099 { 1101 {
1100 byte[] data = new byte[length]; 1102 byte[] data = new byte[length];
1101 stream.Read(data, 0, length); 1103 stream.Read(data, 0, length);
1102 string strdata = Encoding.UTF8.GetString(data); 1104 string strdata = Util.UTF8.GetString(data);
1103 OSDMap args = null; 1105 OSDMap args = null;
1104 OSD buffer; 1106 OSD buffer;
1105 buffer = OSDParser.DeserializeJson(strdata); 1107 buffer = OSDParser.DeserializeJson(strdata);
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 7bc0b77..6b6cb85 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 43d29fd..3f90004 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -4748,7 +4748,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4748 { 4748 {
4749 Hashtable mp = (Hashtable)simMapProfiles[iii]; 4749 Hashtable mp = (Hashtable)simMapProfiles[iii];
4750 mbReply.Data[iii] = new MapBlockReplyPacket.DataBlock(); 4750 mbReply.Data[iii] = new MapBlockReplyPacket.DataBlock();
4751 mbReply.Data[iii].Name = System.Text.Encoding.UTF8.GetBytes((string)mp["name"]); 4751 mbReply.Data[iii].Name = Util.UTF8.GetBytes((string)mp["name"]);
4752 mbReply.Data[iii].Access = System.Convert.ToByte(mp["access"]); 4752 mbReply.Data[iii].Access = System.Convert.ToByte(mp["access"]);
4753 mbReply.Data[iii].Agents = System.Convert.ToByte(mp["agents"]); 4753 mbReply.Data[iii].Agents = System.Convert.ToByte(mp["agents"]);
4754 mbReply.Data[iii].MapImageID = new UUID((string)mp["map-image-id"]); 4754 mbReply.Data[iii].MapImageID = new UUID((string)mp["map-image-id"]);
@@ -7338,7 +7338,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7338 } 7338 }
7339 #endregion 7339 #endregion
7340 7340
7341 string mapName = Encoding.UTF8.GetString(map.NameData.Name, 0, 7341 string mapName = Util.UTF8.GetString(map.NameData.Name, 0,
7342 map.NameData.Name.Length - 1); 7342 map.NameData.Name.Length - 1);
7343 handlerMapNameRequest = OnMapNameRequest; 7343 handlerMapNameRequest = OnMapNameRequest;
7344 if (handlerMapNameRequest != null) 7344 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 7c02f9a..6055384 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 57f5d29..a31cbae 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 65c5274..f9dfc0d 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -527,7 +527,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
527 527
528 if (method == "POST") 528 if (method == "POST")
529 { 529 {
530 byte[] contentreq = Encoding.UTF8.GetBytes(body); 530 byte[] contentreq = Util.UTF8.GetBytes(body);
531 forwardreq.ContentLength = contentreq.Length; 531 forwardreq.ContentLength = contentreq.Length;
532 Stream reqStream = forwardreq.GetRequestStream(); 532 Stream reqStream = forwardreq.GetRequestStream();
533 reqStream.Write(contentreq, 0, contentreq.Length); 533 reqStream.Write(contentreq, 0, contentreq.Length);
@@ -535,7 +535,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
535 } 535 }
536 536
537 HttpWebResponse fwdrsp = (HttpWebResponse)forwardreq.GetResponse(); 537 HttpWebResponse fwdrsp = (HttpWebResponse)forwardreq.GetResponse();
538 Encoding encoding = Encoding.UTF8; 538 Encoding encoding = Util.UTF8;
539 StreamReader fwdresponsestream = new StreamReader(fwdrsp.GetResponseStream(), encoding); 539 StreamReader fwdresponsestream = new StreamReader(fwdrsp.GetResponseStream(), encoding);
540 fwdresponsestr = fwdresponsestream.ReadToEnd(); 540 fwdresponsestr = fwdresponsestream.ReadToEnd();
541 fwdresponsecontenttype = fwdrsp.ContentType; 541 fwdresponsecontenttype = fwdrsp.ContentType;
diff --git a/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs b/OpenSim/Region/OptionalModules/World/TreePopulator/TreePopulatorModule.cs
index d4bba10..b6021a9 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 ba42678..264d585 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -7064,7 +7064,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7064 try 7064 try
7065 { 7065 {
7066 byte[] encData_byte = new byte[str.Length]; 7066 byte[] encData_byte = new byte[str.Length];
7067 encData_byte = Encoding.UTF8.GetBytes(str); 7067 encData_byte = Util.UTF8.GetBytes(str);
7068 string encodedData = Convert.ToBase64String(encData_byte); 7068 string encodedData = Convert.ToBase64String(encData_byte);
7069 return encodedData; 7069 return encodedData;
7070 } 7070 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 726b37a..f80dd51 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -1457,7 +1457,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1457 notecardData = "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length " 1457 notecardData = "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length "
1458 + textLength.ToString() + "\n" + notecardData + "}\n"; 1458 + textLength.ToString() + "\n" + notecardData + "}\n";
1459 1459
1460 asset.Data = Encoding.UTF8.GetBytes(notecardData); 1460 asset.Data = Util.UTF8.GetBytes(notecardData);
1461 World.AssetService.Store(asset); 1461 World.AssetService.Store(asset);
1462 1462
1463 // Create Task Entry 1463 // Create Task Entry
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index 0a36bbe..6e8ead0 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 c0933a8..7aedc1a 100644
--- a/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs
+++ b/OpenSim/Server/Handlers/Neighbour/NeighbourHandlers.cs
@@ -156,7 +156,7 @@ namespace OpenSim.Server.Handlers.Neighbour
156 156
157 httpResponse.StatusCode = (int)HttpStatusCode.OK; 157 httpResponse.StatusCode = (int)HttpStatusCode.OK;
158 158
159 return Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(resp)); 159 return Util.UTF8.GetBytes(OSDParser.SerializeJsonString(resp));
160 } 160 }
161 } 161 }
162 162
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