From 19c5c8b98de2688fb472ac11eb629e4e8c3aab53 Mon Sep 17 00:00:00 2001 From: dr scofield (aka dirk husemann) Date: Mon, 14 Sep 2009 16:14:59 +0200 Subject: fix to preserve UTF8 encoding in saved script state. --- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine') diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 04f7862..650d9fa 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -298,14 +298,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance try { FileInfo fi = new FileInfo(savedState); - int size=(int)fi.Length; + int size = (int)fi.Length; if (size < 512000) { using (FileStream fs = File.Open(savedState, FileMode.Open, FileAccess.Read, FileShare.None)) { - System.Text.ASCIIEncoding enc = - new System.Text.ASCIIEncoding(); + System.Text.UTF8Encoding enc = + new System.Text.UTF8Encoding(); Byte[] data = new Byte[size]; fs.Read(data, 0, size); @@ -899,7 +899,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance try { FileStream fs = File.Create(Path.Combine(Path.GetDirectoryName(assembly), m_ItemID.ToString() + ".state")); - System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); + System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding(); Byte[] buf = enc.GetBytes(xml); fs.Write(buf, 0, buf.Length); fs.Close(); -- cgit v1.1