aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
authordr scofield (aka dirk husemann)2009-09-14 16:14:59 +0200
committerdr scofield (aka dirk husemann)2009-09-14 16:14:59 +0200
commit19c5c8b98de2688fb472ac11eb629e4e8c3aab53 (patch)
tree7a522afa4fe77b94f19f23d20e901420daa38cd5 /OpenSim/Region/ScriptEngine
parent* Add the RegionCombinerModule back (diff)
downloadopensim-SC_OLD-19c5c8b98de2688fb472ac11eb629e4e8c3aab53.zip
opensim-SC_OLD-19c5c8b98de2688fb472ac11eb629e4e8c3aab53.tar.gz
opensim-SC_OLD-19c5c8b98de2688fb472ac11eb629e4e8c3aab53.tar.bz2
opensim-SC_OLD-19c5c8b98de2688fb472ac11eb629e4e8c3aab53.tar.xz
fix to preserve UTF8 encoding in saved script state.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs8
1 files changed, 4 insertions, 4 deletions
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
298 try 298 try
299 { 299 {
300 FileInfo fi = new FileInfo(savedState); 300 FileInfo fi = new FileInfo(savedState);
301 int size=(int)fi.Length; 301 int size = (int)fi.Length;
302 if (size < 512000) 302 if (size < 512000)
303 { 303 {
304 using (FileStream fs = File.Open(savedState, 304 using (FileStream fs = File.Open(savedState,
305 FileMode.Open, FileAccess.Read, FileShare.None)) 305 FileMode.Open, FileAccess.Read, FileShare.None))
306 { 306 {
307 System.Text.ASCIIEncoding enc = 307 System.Text.UTF8Encoding enc =
308 new System.Text.ASCIIEncoding(); 308 new System.Text.UTF8Encoding();
309 309
310 Byte[] data = new Byte[size]; 310 Byte[] data = new Byte[size];
311 fs.Read(data, 0, size); 311 fs.Read(data, 0, size);
@@ -899,7 +899,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
899 try 899 try
900 { 900 {
901 FileStream fs = File.Create(Path.Combine(Path.GetDirectoryName(assembly), m_ItemID.ToString() + ".state")); 901 FileStream fs = File.Create(Path.Combine(Path.GetDirectoryName(assembly), m_ItemID.ToString() + ".state"));
902 System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); 902 System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding();
903 Byte[] buf = enc.GetBytes(xml); 903 Byte[] buf = enc.GetBytes(xml);
904 fs.Write(buf, 0, buf.Length); 904 fs.Write(buf, 0, buf.Length);
905 fs.Close(); 905 fs.Close();