From eacdad8405c7af612d6c8fd6b5b4b5847a66169c Mon Sep 17 00:00:00 2001 From: Freaky Tech Date: Wed, 4 Mar 2015 18:36:14 +0100 Subject: simplify llStringToBase64 and llBase64ToString Signed-off-by: BlueWall --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6a30da2..31ae64f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -8228,7 +8228,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); try { - byte[] encData_byte = new byte[str.Length]; + byte[] encData_byte; encData_byte = Util.UTF8.GetBytes(str); string encodedData = Convert.ToBase64String(encData_byte); return encodedData; @@ -8245,7 +8245,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); try { - return Util.Base64ToString(str); + byte[] b = Convert.FromBase64String(str); + return Encoding.UTF8.GetString(b); } catch { -- cgit v1.1