From d8a787bd89eb05d417a5abc37ffebe8ed73db6c5 Mon Sep 17 00:00:00 2001 From: "dr scofield (aka dirk husemann)" Date: Tue, 8 Sep 2009 17:53:28 +0200 Subject: [PATCH] fix: unicode notecards not surviving script treatment (fixes #4119 --- perhaps). --- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 8 ++++---- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index f261c16d32..017a6f67d2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -9477,8 +9477,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } - System.Text.ASCIIEncoding enc = - new System.Text.ASCIIEncoding(); + System.Text.UTF8Encoding enc = + new System.Text.UTF8Encoding(); string data = enc.GetString(a.Data); //m_log.Debug(data); NotecardCache.Cache(id, data); @@ -9539,8 +9539,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return; } - System.Text.ASCIIEncoding enc = - new System.Text.ASCIIEncoding(); + System.Text.UTF8Encoding enc = + new System.Text.UTF8Encoding(); string data = enc.GetString(a.Data); //m_log.Debug(data); NotecardCache.Cache(id, data); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index bca019b72d..726b37a077 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1457,7 +1457,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api notecardData = "Linden text version 2\n{\nLLEmbeddedItems version 1\n{\ncount 0\n}\nText length " + textLength.ToString() + "\n" + notecardData + "}\n"; - asset.Data = Encoding.ASCII.GetBytes(notecardData); + asset.Data = Encoding.UTF8.GetBytes(notecardData); World.AssetService.Store(asset); // Create Task Entry @@ -1522,7 +1522,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api AssetBase a = World.AssetService.Get(assetID.ToString()); if (a != null) { - System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); + System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding(); string data = enc.GetString(a.Data); NotecardCache.Cache(assetID, data); } @@ -1575,7 +1575,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api AssetBase a = World.AssetService.Get(assetID.ToString()); if (a != null) { - System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); + System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding(); string data = enc.GetString(a.Data); NotecardCache.Cache(assetID, data); } @@ -1632,7 +1632,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api AssetBase a = World.AssetService.Get(assetID.ToString()); if (a != null) { - System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); + System.Text.UTF8Encoding enc = new System.Text.UTF8Encoding(); string data = enc.GetString(a.Data); NotecardCache.Cache(assetID, data); }