fix to preserve UTF8 encoding in saved script state.
parent
feccfe4096
commit
19c5c8b98d
|
@ -298,14 +298,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
FileInfo fi = new FileInfo(savedState);
|
FileInfo fi = new FileInfo(savedState);
|
||||||
int size=(int)fi.Length;
|
int size = (int)fi.Length;
|
||||||
if (size < 512000)
|
if (size < 512000)
|
||||||
{
|
{
|
||||||
using (FileStream fs = File.Open(savedState,
|
using (FileStream fs = File.Open(savedState,
|
||||||
FileMode.Open, FileAccess.Read, FileShare.None))
|
FileMode.Open, FileAccess.Read, FileShare.None))
|
||||||
{
|
{
|
||||||
System.Text.ASCIIEncoding enc =
|
System.Text.UTF8Encoding enc =
|
||||||
new System.Text.ASCIIEncoding();
|
new System.Text.UTF8Encoding();
|
||||||
|
|
||||||
Byte[] data = new Byte[size];
|
Byte[] data = new Byte[size];
|
||||||
fs.Read(data, 0, size);
|
fs.Read(data, 0, size);
|
||||||
|
@ -899,7 +899,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
FileStream fs = File.Create(Path.Combine(Path.GetDirectoryName(assembly), m_ItemID.ToString() + ".state"));
|
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);
|
Byte[] buf = enc.GetBytes(xml);
|
||||||
fs.Write(buf, 0, buf.Length);
|
fs.Write(buf, 0, buf.Length);
|
||||||
fs.Close();
|
fs.Close();
|
||||||
|
|
Loading…
Reference in New Issue