aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAdam Frisby2008-03-21 02:26:00 +0000
committerAdam Frisby2008-03-21 02:26:00 +0000
commit7286bd60b07e809f33215256cc71b39c15437c65 (patch)
treea3d55e49cfcbc9a756e0816ac5ea8b9d97f26082
parent* Fix for #499: linked primsets don't rotate properly when using a door scrip... (diff)
downloadopensim-SC_OLD-7286bd60b07e809f33215256cc71b39c15437c65.zip
opensim-SC_OLD-7286bd60b07e809f33215256cc71b39c15437c65.tar.gz
opensim-SC_OLD-7286bd60b07e809f33215256cc71b39c15437c65.tar.bz2
opensim-SC_OLD-7286bd60b07e809f33215256cc71b39c15437c65.tar.xz
* Converted a large number of ASCII encodings to UTF8.
* We should not be using ASCII anywhere except for legacy compatibility reasons. * A large number of UTF8 Encoders are being used in places where we should be using Util.StringToField instead. These have been tagged with // ENCODING FAULT * This should fix Mantis#799 - Japanese Profile Text does not work.
-rw-r--r--OpenSim/Framework/Communications/Capabilities/LLSD.cs2
-rw-r--r--OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs2
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs20
-rw-r--r--OpenSim/Region/Environment/EstateManager.cs3
-rw-r--r--OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs1
7 files changed, 20 insertions, 13 deletions
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSD.cs b/OpenSim/Framework/Communications/Capabilities/LLSD.cs
index 8e2a194..b3e841c 100644
--- a/OpenSim/Framework/Communications/Capabilities/LLSD.cs
+++ b/OpenSim/Framework/Communications/Capabilities/LLSD.cs
@@ -329,7 +329,7 @@ namespace OpenSim.Region.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.ASCII.GetBytes(reader.ReadString()); 332 byte[] inp = Encoding.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/Configuration/HTTP/HTTPConfiguration.cs b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs
index fa8d8fe..1fb4866 100644
--- a/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs
+++ b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs
@@ -74,7 +74,7 @@ namespace OpenSim.Framework.Configuration.HTTP
74 count = resStream.Read(buf, 0, buf.Length); 74 count = resStream.Read(buf, 0, buf.Length);
75 if (count != 0) 75 if (count != 0)
76 { 76 {
77 tempString = Encoding.ASCII.GetString(buf, 0, count); 77 tempString = Encoding.UTF8.GetString(buf, 0, count);
78 sb.Append(tempString); 78 sb.Append(tempString);
79 } 79 }
80 } while (count > 0); 80 } while (count > 0);
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index f1ecc8a..0215994 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -84,7 +84,8 @@ namespace OpenSim.Region.ClientStack
84 private int m_lastPacketsReceived = 0; 84 private int m_lastPacketsReceived = 0;
85 private byte[] ZeroOutBuffer = new byte[4096]; 85 private byte[] ZeroOutBuffer = new byte[4096];
86 86
87 private readonly Encoding m_encoding = Encoding.ASCII; 87 // ENCODING FAULT
88 private readonly Encoding m_encoding = Encoding.UTF8;
88 private readonly LLUUID m_agentId; 89 private readonly LLUUID m_agentId;
89 private readonly uint m_circuitCode; 90 private readonly uint m_circuitCode;
90 private int m_moneyBalance; 91 private int m_moneyBalance;
@@ -1165,7 +1166,8 @@ namespace OpenSim.Region.ClientStack
1165 // 6 to 7 items at a time, so let's stick with 6 1166 // 6 to 7 items at a time, so let's stick with 6
1166 int MAX_ITEMS_PER_PACKET = 6; 1167 int MAX_ITEMS_PER_PACKET = 6;
1167 1168
1168 Encoding enc = Encoding.ASCII; 1169 // ENCODING FAULT
1170 Encoding enc = Encoding.UTF8;
1169 uint FULL_MASK_PERMISSIONS = 2147483647; 1171 uint FULL_MASK_PERMISSIONS = 2147483647;
1170 1172
1171 if (fetchItems) 1173 if (fetchItems)
@@ -1336,7 +1338,8 @@ namespace OpenSim.Region.ClientStack
1336 1338
1337 public void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item) 1339 public void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item)
1338 { 1340 {
1339 Encoding enc = Encoding.ASCII; 1341 // ENCODING FAULT
1342 Encoding enc = Encoding.UTF8;
1340 uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All; 1343 uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All;
1341 FetchInventoryReplyPacket inventoryReply = (FetchInventoryReplyPacket)PacketPool.Instance.GetPacket(PacketType.FetchInventoryReply); 1344 FetchInventoryReplyPacket inventoryReply = (FetchInventoryReplyPacket)PacketPool.Instance.GetPacket(PacketType.FetchInventoryReply);
1342 // TODO: don't create new blocks if recycling an old packet 1345 // TODO: don't create new blocks if recycling an old packet
@@ -1378,7 +1381,8 @@ namespace OpenSim.Region.ClientStack
1378 /// <see>IClientAPI.SendInventoryItemCreateUpdate(InventoryItemBase)</see> 1381 /// <see>IClientAPI.SendInventoryItemCreateUpdate(InventoryItemBase)</see>
1379 public void SendInventoryItemCreateUpdate(InventoryItemBase Item) 1382 public void SendInventoryItemCreateUpdate(InventoryItemBase Item)
1380 { 1383 {
1381 Encoding enc = Encoding.ASCII; 1384 // ENCODING FAULT
1385 Encoding enc = Encoding.UTF8;
1382 uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All; 1386 uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All;
1383 UpdateCreateInventoryItemPacket InventoryReply = (UpdateCreateInventoryItemPacket)PacketPool.Instance.GetPacket(PacketType.UpdateCreateInventoryItem); 1387 UpdateCreateInventoryItemPacket InventoryReply = (UpdateCreateInventoryItemPacket)PacketPool.Instance.GetPacket(PacketType.UpdateCreateInventoryItem);
1384 // TODO: don't create new blocks if recycling an old packet 1388 // TODO: don't create new blocks if recycling an old packet
@@ -2213,7 +2217,8 @@ namespace OpenSim.Region.ClientStack
2213 { 2217 {
2214 objdata.TextureEntry = textureEntry; 2218 objdata.TextureEntry = textureEntry;
2215 } 2219 }
2216 Encoding enc = Encoding.ASCII; 2220 // ENCODING FAULT
2221 Encoding enc = Encoding.UTF8;
2217 LLVector3 pos = new LLVector3(objdata.ObjectData, 16); 2222 LLVector3 pos = new LLVector3(objdata.ObjectData, 16);
2218 pos.X = 100f; 2223 pos.X = 100f;
2219 objdata.ID = 8880000; 2224 objdata.ID = 8880000;
@@ -2941,7 +2946,8 @@ namespace OpenSim.Region.ClientStack
2941 } 2946 }
2942 else 2947 else
2943 { 2948 {
2944 Encoding _enc = Encoding.ASCII; 2949 // ENCODING FAULT
2950 Encoding _enc = Encoding.UTF8;
2945 2951
2946 switch (Pack.Type) 2952 switch (Pack.Type)
2947 { 2953 {
@@ -3989,7 +3995,7 @@ namespace OpenSim.Region.ClientStack
3989 OutPacket(tpStart, ThrottleOutPacketType.Task); 3995 OutPacket(tpStart, ThrottleOutPacketType.Task);
3990 3996
3991 TeleportProgressPacket tpProgress = (TeleportProgressPacket)PacketPool.Instance.GetPacket(PacketType.TeleportProgress); 3997 TeleportProgressPacket tpProgress = (TeleportProgressPacket)PacketPool.Instance.GetPacket(PacketType.TeleportProgress);
3992 tpProgress.Info.Message = (new ASCIIEncoding()).GetBytes("sending_landmark"); 3998 tpProgress.Info.Message = (new UTF8Encoding()).GetBytes("sending_landmark");
3993 tpProgress.Info.TeleportFlags = 8; 3999 tpProgress.Info.TeleportFlags = 8;
3994 tpProgress.AgentData.AgentID = tpReq.Info.AgentID; 4000 tpProgress.AgentData.AgentID = tpReq.Info.AgentID;
3995 OutPacket(tpProgress, ThrottleOutPacketType.Task); 4001 OutPacket(tpProgress, ThrottleOutPacketType.Task);
diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs
index 39efecd..9c53f38 100644
--- a/OpenSim/Region/Environment/EstateManager.cs
+++ b/OpenSim/Region/Environment/EstateManager.cs
@@ -634,7 +634,8 @@ namespace OpenSim.Region.Environment
634 634
635 public void sendRegionInfoPacket(IClientAPI remote_client) 635 public void sendRegionInfoPacket(IClientAPI remote_client)
636 { 636 {
637 Encoding _enc = Encoding.ASCII; 637 // ENCODING FAULT
638 Encoding _enc = Encoding.UTF8;
638 639
639 AgentCircuitData circuitData = remote_client.RequestClientInfo(); 640 AgentCircuitData circuitData = remote_client.RequestClientInfo();
640 641
diff --git a/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs b/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs
index ebc8568..10e3840 100644
--- a/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/Environment/Modules/ScriptsHttpRequests.cs
@@ -328,7 +328,7 @@ namespace OpenSim.Region.Environment.Modules
328 if (count != 0) 328 if (count != 0)
329 { 329 {
330 // translate from bytes to ASCII text 330 // translate from bytes to ASCII text
331 tempString = Encoding.ASCII.GetString(buf, 0, count); 331 tempString = Encoding.UTF8.GetString(buf, 0, count);
332 332
333 // continue building the string 333 // continue building the string
334 sb.Append(tempString); 334 sb.Append(tempString);
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 327956e..b0ed04e 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -45,7 +45,8 @@ namespace OpenSim.Region.Environment.Scenes
45 45
46 public partial class SceneObjectGroup : EntityBase 46 public partial class SceneObjectGroup : EntityBase
47 { 47 {
48 private Encoding enc = Encoding.ASCII; 48 // ENCODING FAULT
49 private Encoding enc = Encoding.UTF8;
49 50
50 protected SceneObjectPart m_rootPart; 51 protected SceneObjectPart m_rootPart;
51 52
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index f925955..a3f546d 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -51,7 +51,6 @@ namespace OpenSim.Region.ScriptEngine.Common
51 { 51 {
52 // private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 52 // private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
53 53
54 // private ASCIIEncoding enc = new ASCIIEncoding();
55 private ScriptEngineBase.ScriptEngine m_ScriptEngine; 54 private ScriptEngineBase.ScriptEngine m_ScriptEngine;
56 private SceneObjectPart m_host; 55 private SceneObjectPart m_host;
57 private uint m_localID; 56 private uint m_localID;