From b0b7b45b943dd94546bcfcf5d3bb871cfe35b507 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 3 May 2012 19:38:35 +0300 Subject: Save the Telehub and its Spawn Points in the OAR Signed-off-by: BlueWall --- .../External/RegionSettingsSerializer.cs | 37 ++++++++++++++++++++-- .../Tests/RegionSettingsSerializerTests.cs | 8 +++++ 2 files changed, 43 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/Serialization') diff --git a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs index 931898c..f18435d 100644 --- a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs +++ b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs @@ -30,6 +30,8 @@ using System.Text; using System.Xml; using OpenMetaverse; using OpenSim.Framework; +using log4net; +using System.Reflection; namespace OpenSim.Framework.Serialization.External { @@ -187,7 +189,29 @@ namespace OpenSim.Framework.Serialization.External break; } } - + + xtr.ReadEndElement(); + + if (xtr.IsStartElement("Telehub")) + { + xtr.ReadStartElement("Telehub"); + + while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) + { + switch (xtr.Name) + { + case "TelehubObject": + settings.TelehubObject = UUID.Parse(xtr.ReadElementContentAsString()); + break; + case "SpawnPoint": + string str = xtr.ReadElementContentAsString(); + SpawnPoint sp = SpawnPoint.Parse(str); + settings.AddSpawnPoint(sp); + break; + } + } + } + xtr.Close(); sr.Close(); @@ -243,7 +267,16 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteElementString("SunPosition", settings.SunPosition.ToString()); // Note: 'SunVector' isn't saved because this value is owned by the Sun Module, which // calculates it automatically according to the date and other factors. - xtw.WriteEndElement(); + xtw.WriteEndElement(); + + xtw.WriteStartElement("Telehub"); + if (settings.TelehubObject != UUID.Zero) + { + xtw.WriteElementString("TelehubObject", settings.TelehubObject.ToString()); + foreach (SpawnPoint sp in settings.SpawnPoints()) + xtw.WriteElementString("SpawnPoint", sp.ToString()); + } + xtw.WriteEndElement(); xtw.WriteEndElement(); diff --git a/OpenSim/Framework/Serialization/Tests/RegionSettingsSerializerTests.cs b/OpenSim/Framework/Serialization/Tests/RegionSettingsSerializerTests.cs index a61e4af..09b6f6d 100644 --- a/OpenSim/Framework/Serialization/Tests/RegionSettingsSerializerTests.cs +++ b/OpenSim/Framework/Serialization/Tests/RegionSettingsSerializerTests.cs @@ -78,6 +78,10 @@ namespace OpenSim.Framework.Serialization.Tests true 12 + + 00000000-0000-0000-0000-111111111111 + 1,-2,0.33 + "; private RegionSettings m_rs; @@ -116,6 +120,8 @@ namespace OpenSim.Framework.Serialization.Tests m_rs.TerrainTexture4 = UUID.Parse("00000000-0000-0000-0000-000000000080"); m_rs.UseEstateSun = true; m_rs.WaterHeight = 23; + m_rs.TelehubObject = UUID.Parse("00000000-0000-0000-0000-111111111111"); + m_rs.AddSpawnPoint(SpawnPoint.Parse("1,-2,0.33")); } [Test] @@ -129,6 +135,8 @@ namespace OpenSim.Framework.Serialization.Tests Assert.That(deserRs.TerrainTexture2, Is.EqualTo(m_rs.TerrainTexture2)); Assert.That(deserRs.DisablePhysics, Is.EqualTo(m_rs.DisablePhysics)); Assert.That(deserRs.TerrainLowerLimit, Is.EqualTo(m_rs.TerrainLowerLimit)); + Assert.That(deserRs.TelehubObject, Is.EqualTo(m_rs.TelehubObject)); + Assert.That(deserRs.SpawnPoints()[0].ToString(), Is.EqualTo(m_rs.SpawnPoints()[0].ToString())); } } } -- cgit v1.1 From 8b958e7e74d8e4b462c6a59c2854c5072ff8c746 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 12 May 2012 02:36:56 +0100 Subject: Revert "Save the Telehub and its Spawn Points in the OAR" This reverts commit b0b7b45b943dd94546bcfcf5d3bb871cfe35b507. Sorry BlueWall, I wanted to discuss an aspect of the data storage but I couldn't assign bugs in 'patch included' state to myself until I changed mantis just now and I forgot to mention it on irc. I wouldn't normally revert but thinks get tricky when it comes to data formats. Essentially, I would like to see the Yaw, Pitch and Distance values as separate XML entities (as used in other aspects such as vectors, quaternions) rather than as a . delimited string We can discuss this more with Oren in opensimulator.org/mantis/view.php?id=6008 --- .../External/RegionSettingsSerializer.cs | 37 ++-------------------- .../Tests/RegionSettingsSerializerTests.cs | 8 ----- 2 files changed, 2 insertions(+), 43 deletions(-) (limited to 'OpenSim/Framework/Serialization') diff --git a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs index f18435d..931898c 100644 --- a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs +++ b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs @@ -30,8 +30,6 @@ using System.Text; using System.Xml; using OpenMetaverse; using OpenSim.Framework; -using log4net; -using System.Reflection; namespace OpenSim.Framework.Serialization.External { @@ -189,29 +187,7 @@ namespace OpenSim.Framework.Serialization.External break; } } - - xtr.ReadEndElement(); - - if (xtr.IsStartElement("Telehub")) - { - xtr.ReadStartElement("Telehub"); - - while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) - { - switch (xtr.Name) - { - case "TelehubObject": - settings.TelehubObject = UUID.Parse(xtr.ReadElementContentAsString()); - break; - case "SpawnPoint": - string str = xtr.ReadElementContentAsString(); - SpawnPoint sp = SpawnPoint.Parse(str); - settings.AddSpawnPoint(sp); - break; - } - } - } - + xtr.Close(); sr.Close(); @@ -267,16 +243,7 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteElementString("SunPosition", settings.SunPosition.ToString()); // Note: 'SunVector' isn't saved because this value is owned by the Sun Module, which // calculates it automatically according to the date and other factors. - xtw.WriteEndElement(); - - xtw.WriteStartElement("Telehub"); - if (settings.TelehubObject != UUID.Zero) - { - xtw.WriteElementString("TelehubObject", settings.TelehubObject.ToString()); - foreach (SpawnPoint sp in settings.SpawnPoints()) - xtw.WriteElementString("SpawnPoint", sp.ToString()); - } - xtw.WriteEndElement(); + xtw.WriteEndElement(); xtw.WriteEndElement(); diff --git a/OpenSim/Framework/Serialization/Tests/RegionSettingsSerializerTests.cs b/OpenSim/Framework/Serialization/Tests/RegionSettingsSerializerTests.cs index 09b6f6d..a61e4af 100644 --- a/OpenSim/Framework/Serialization/Tests/RegionSettingsSerializerTests.cs +++ b/OpenSim/Framework/Serialization/Tests/RegionSettingsSerializerTests.cs @@ -78,10 +78,6 @@ namespace OpenSim.Framework.Serialization.Tests true 12 - - 00000000-0000-0000-0000-111111111111 - 1,-2,0.33 - "; private RegionSettings m_rs; @@ -120,8 +116,6 @@ namespace OpenSim.Framework.Serialization.Tests m_rs.TerrainTexture4 = UUID.Parse("00000000-0000-0000-0000-000000000080"); m_rs.UseEstateSun = true; m_rs.WaterHeight = 23; - m_rs.TelehubObject = UUID.Parse("00000000-0000-0000-0000-111111111111"); - m_rs.AddSpawnPoint(SpawnPoint.Parse("1,-2,0.33")); } [Test] @@ -135,8 +129,6 @@ namespace OpenSim.Framework.Serialization.Tests Assert.That(deserRs.TerrainTexture2, Is.EqualTo(m_rs.TerrainTexture2)); Assert.That(deserRs.DisablePhysics, Is.EqualTo(m_rs.DisablePhysics)); Assert.That(deserRs.TerrainLowerLimit, Is.EqualTo(m_rs.TerrainLowerLimit)); - Assert.That(deserRs.TelehubObject, Is.EqualTo(m_rs.TelehubObject)); - Assert.That(deserRs.SpawnPoints()[0].ToString(), Is.EqualTo(m_rs.SpawnPoints()[0].ToString())); } } } -- cgit v1.1 From 52a32878a9573681e3b56d0151c4a0903719eadf Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 3 May 2012 19:38:35 +0300 Subject: Save the Telehub and its Spawn Points in the OAR --- .../External/RegionSettingsSerializer.cs | 37 ++++++++++++++++++++-- .../Tests/RegionSettingsSerializerTests.cs | 8 +++++ 2 files changed, 43 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/Serialization') diff --git a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs index 931898c..f18435d 100644 --- a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs +++ b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs @@ -30,6 +30,8 @@ using System.Text; using System.Xml; using OpenMetaverse; using OpenSim.Framework; +using log4net; +using System.Reflection; namespace OpenSim.Framework.Serialization.External { @@ -187,7 +189,29 @@ namespace OpenSim.Framework.Serialization.External break; } } - + + xtr.ReadEndElement(); + + if (xtr.IsStartElement("Telehub")) + { + xtr.ReadStartElement("Telehub"); + + while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) + { + switch (xtr.Name) + { + case "TelehubObject": + settings.TelehubObject = UUID.Parse(xtr.ReadElementContentAsString()); + break; + case "SpawnPoint": + string str = xtr.ReadElementContentAsString(); + SpawnPoint sp = SpawnPoint.Parse(str); + settings.AddSpawnPoint(sp); + break; + } + } + } + xtr.Close(); sr.Close(); @@ -243,7 +267,16 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteElementString("SunPosition", settings.SunPosition.ToString()); // Note: 'SunVector' isn't saved because this value is owned by the Sun Module, which // calculates it automatically according to the date and other factors. - xtw.WriteEndElement(); + xtw.WriteEndElement(); + + xtw.WriteStartElement("Telehub"); + if (settings.TelehubObject != UUID.Zero) + { + xtw.WriteElementString("TelehubObject", settings.TelehubObject.ToString()); + foreach (SpawnPoint sp in settings.SpawnPoints()) + xtw.WriteElementString("SpawnPoint", sp.ToString()); + } + xtw.WriteEndElement(); xtw.WriteEndElement(); diff --git a/OpenSim/Framework/Serialization/Tests/RegionSettingsSerializerTests.cs b/OpenSim/Framework/Serialization/Tests/RegionSettingsSerializerTests.cs index a61e4af..09b6f6d 100644 --- a/OpenSim/Framework/Serialization/Tests/RegionSettingsSerializerTests.cs +++ b/OpenSim/Framework/Serialization/Tests/RegionSettingsSerializerTests.cs @@ -78,6 +78,10 @@ namespace OpenSim.Framework.Serialization.Tests true 12 + + 00000000-0000-0000-0000-111111111111 + 1,-2,0.33 + "; private RegionSettings m_rs; @@ -116,6 +120,8 @@ namespace OpenSim.Framework.Serialization.Tests m_rs.TerrainTexture4 = UUID.Parse("00000000-0000-0000-0000-000000000080"); m_rs.UseEstateSun = true; m_rs.WaterHeight = 23; + m_rs.TelehubObject = UUID.Parse("00000000-0000-0000-0000-111111111111"); + m_rs.AddSpawnPoint(SpawnPoint.Parse("1,-2,0.33")); } [Test] @@ -129,6 +135,8 @@ namespace OpenSim.Framework.Serialization.Tests Assert.That(deserRs.TerrainTexture2, Is.EqualTo(m_rs.TerrainTexture2)); Assert.That(deserRs.DisablePhysics, Is.EqualTo(m_rs.DisablePhysics)); Assert.That(deserRs.TerrainLowerLimit, Is.EqualTo(m_rs.TerrainLowerLimit)); + Assert.That(deserRs.TelehubObject, Is.EqualTo(m_rs.TelehubObject)); + Assert.That(deserRs.SpawnPoints()[0].ToString(), Is.EqualTo(m_rs.SpawnPoints()[0].ToString())); } } } -- cgit v1.1 From 1926de5a0599051c27c065fb06da3dc536e6784a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 30 Jun 2012 01:25:27 +0100 Subject: Remove some mono compiler warnings --- OpenSim/Framework/Serialization/External/LandDataSerializer.cs | 2 +- OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework/Serialization') diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs index a12877a..e8d82d3 100644 --- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs @@ -42,7 +42,7 @@ namespace OpenSim.Framework.Serialization.External /// public class LandDataSerializer { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); diff --git a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs index 57da7ca..88f9581 100644 --- a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs @@ -44,7 +44,7 @@ namespace OpenSim.Framework.Serialization.External /// public class UserInventoryItemSerializer { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static Dictionary> m_InventoryItemXmlProcessors = new Dictionary>(); -- cgit v1.1 From 916e3bf886ee622e2f18d6eb74f90fee8c630471 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 11 Jul 2012 22:54:22 +0100 Subject: 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. --- .../Serialization/External/LandDataSerializer.cs | 4 +--- .../External/RegionSettingsSerializer.cs | 4 +--- .../Framework/Serialization/TarArchiveReader.cs | 8 +++----- .../Framework/Serialization/TarArchiveWriter.cs | 23 +++++++++++----------- 4 files changed, 16 insertions(+), 23 deletions(-) (limited to 'OpenSim/Framework/Serialization') diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs index e8d82d3..a64f01c 100644 --- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs @@ -44,8 +44,6 @@ namespace OpenSim.Framework.Serialization.External { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); - private static Dictionary> m_ldProcessors = new Dictionary>(); @@ -163,7 +161,7 @@ namespace OpenSim.Framework.Serialization.External /// public static LandData Deserialize(byte[] serializedLandData) { - return Deserialize(m_utf8Encoding.GetString(serializedLandData, 0, serializedLandData.Length)); + return Deserialize(Encoding.UTF8.GetString(serializedLandData, 0, serializedLandData.Length)); } /// diff --git a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs index f18435d..19468c3 100644 --- a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs +++ b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs @@ -40,8 +40,6 @@ namespace OpenSim.Framework.Serialization.External /// public class RegionSettingsSerializer { - protected static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding(); - /// /// Deserialize settings /// @@ -50,7 +48,7 @@ namespace OpenSim.Framework.Serialization.External /// public static RegionSettings Deserialize(byte[] serializedSettings) { - return Deserialize(m_asciiEncoding.GetString(serializedSettings, 0, serializedSettings.Length)); + return Deserialize(Encoding.ASCII.GetString(serializedSettings, 0, serializedSettings.Length)); } /// diff --git a/OpenSim/Framework/Serialization/TarArchiveReader.cs b/OpenSim/Framework/Serialization/TarArchiveReader.cs index 77c29f8..339a37a 100644 --- a/OpenSim/Framework/Serialization/TarArchiveReader.cs +++ b/OpenSim/Framework/Serialization/TarArchiveReader.cs @@ -53,8 +53,6 @@ namespace OpenSim.Framework.Serialization TYPE_CONTIGUOUS_FILE = 8, } - protected static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding(); - /// /// Binary reader for the underlying stream /// @@ -120,13 +118,13 @@ namespace OpenSim.Framework.Serialization if (header[156] == (byte)'L') { int longNameLength = ConvertOctalBytesToDecimal(header, 124, 11); - tarHeader.FilePath = m_asciiEncoding.GetString(ReadData(longNameLength)); + tarHeader.FilePath = Encoding.ASCII.GetString(ReadData(longNameLength)); //m_log.DebugFormat("[TAR ARCHIVE READER]: Got long file name {0}", tarHeader.FilePath); header = m_br.ReadBytes(512); } else { - tarHeader.FilePath = m_asciiEncoding.GetString(header, 0, 100); + tarHeader.FilePath = Encoding.ASCII.GetString(header, 0, 100); tarHeader.FilePath = tarHeader.FilePath.Trim(m_nullCharArray); //m_log.DebugFormat("[TAR ARCHIVE READER]: Got short file name {0}", tarHeader.FilePath); } @@ -205,7 +203,7 @@ namespace OpenSim.Framework.Serialization { // Trim leading white space: ancient tars do that instead // of leading 0s :-( don't ask. really. - string oString = m_asciiEncoding.GetString(bytes, startIndex, count).TrimStart(m_spaceCharArray); + string oString = Encoding.ASCII.GetString(bytes, startIndex, count).TrimStart(m_spaceCharArray); int d = 0; diff --git a/OpenSim/Framework/Serialization/TarArchiveWriter.cs b/OpenSim/Framework/Serialization/TarArchiveWriter.cs index fca909f..122fa8e 100644 --- a/OpenSim/Framework/Serialization/TarArchiveWriter.cs +++ b/OpenSim/Framework/Serialization/TarArchiveWriter.cs @@ -41,7 +41,6 @@ namespace OpenSim.Framework.Serialization { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - protected static ASCIIEncoding m_asciiEncoding = new ASCIIEncoding(); protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); /// @@ -85,7 +84,7 @@ namespace OpenSim.Framework.Serialization public void WriteFile(string filePath, byte[] data) { if (filePath.Length > 100) - WriteEntry("././@LongLink", m_asciiEncoding.GetBytes(filePath), 'L'); + WriteEntry("././@LongLink", Encoding.ASCII.GetBytes(filePath), 'L'); char fileType; @@ -137,7 +136,7 @@ namespace OpenSim.Framework.Serialization oString = "0" + oString; } - byte[] oBytes = m_asciiEncoding.GetBytes(oString); + byte[] oBytes = Encoding.ASCII.GetBytes(oString); return oBytes; } @@ -156,20 +155,20 @@ namespace OpenSim.Framework.Serialization byte[] header = new byte[512]; // file path field (100) - byte[] nameBytes = m_asciiEncoding.GetBytes(filePath); + byte[] nameBytes = Encoding.ASCII.GetBytes(filePath); int nameSize = (nameBytes.Length >= 100) ? 100 : nameBytes.Length; Array.Copy(nameBytes, header, nameSize); // file mode (8) - byte[] modeBytes = m_asciiEncoding.GetBytes("0000777"); + byte[] modeBytes = Encoding.ASCII.GetBytes("0000777"); Array.Copy(modeBytes, 0, header, 100, 7); // owner user id (8) - byte[] ownerIdBytes = m_asciiEncoding.GetBytes("0000764"); + byte[] ownerIdBytes = Encoding.ASCII.GetBytes("0000764"); Array.Copy(ownerIdBytes, 0, header, 108, 7); // group user id (8) - byte[] groupIdBytes = m_asciiEncoding.GetBytes("0000764"); + byte[] groupIdBytes = Encoding.ASCII.GetBytes("0000764"); Array.Copy(groupIdBytes, 0, header, 116, 7); // file size in bytes (12) @@ -181,17 +180,17 @@ namespace OpenSim.Framework.Serialization Array.Copy(fileSizeBytes, 0, header, 124, 11); // last modification time (12) - byte[] lastModTimeBytes = m_asciiEncoding.GetBytes("11017037332"); + byte[] lastModTimeBytes = Encoding.ASCII.GetBytes("11017037332"); Array.Copy(lastModTimeBytes, 0, header, 136, 11); // entry type indicator (1) - header[156] = m_asciiEncoding.GetBytes(new char[] { fileType })[0]; + header[156] = Encoding.ASCII.GetBytes(new char[] { fileType })[0]; - Array.Copy(m_asciiEncoding.GetBytes("0000000"), 0, header, 329, 7); - Array.Copy(m_asciiEncoding.GetBytes("0000000"), 0, header, 337, 7); + Array.Copy(Encoding.ASCII.GetBytes("0000000"), 0, header, 329, 7); + Array.Copy(Encoding.ASCII.GetBytes("0000000"), 0, header, 337, 7); // check sum for header block (8) [calculated last] - Array.Copy(m_asciiEncoding.GetBytes(" "), 0, header, 148, 8); + Array.Copy(Encoding.ASCII.GetBytes(" "), 0, header, 148, 8); int checksum = 0; foreach (byte b in header) -- cgit v1.1 From 884d603cac6c3fe0cdbd199e13e1514146ff82bc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 13 Jul 2012 01:03:28 +0100 Subject: Rather than instantiating a UTF8 encoding everywhere when we want to supress the BOM, use a single Util.UTF8NoBomEncoding. This class is thread-safe (as evidenced by the provision of the system-wide Encoding.UTF8 which does not suppress BOM on output). --- OpenSim/Framework/Serialization/TarArchiveWriter.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'OpenSim/Framework/Serialization') diff --git a/OpenSim/Framework/Serialization/TarArchiveWriter.cs b/OpenSim/Framework/Serialization/TarArchiveWriter.cs index 122fa8e..2a3bc48 100644 --- a/OpenSim/Framework/Serialization/TarArchiveWriter.cs +++ b/OpenSim/Framework/Serialization/TarArchiveWriter.cs @@ -41,8 +41,6 @@ namespace OpenSim.Framework.Serialization { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); - /// /// Binary writer for the underlying stream /// @@ -73,7 +71,7 @@ namespace OpenSim.Framework.Serialization /// public void WriteFile(string filePath, string data) { - WriteFile(filePath, m_utf8Encoding.GetBytes(data)); + WriteFile(filePath, Util.UTF8NoBomEncoding.GetBytes(data)); } /// -- cgit v1.1