From fb9a358b797418fbc4c38dd9ec67e12bb5b7c98a Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 31 Mar 2009 05:51:28 +0000 Subject: * Refactored out and de-duplicated Base64ToString(string) * Fixed minor typo --- OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'OpenSim/ApplicationPlugins/Rest/Inventory') diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs index 62e18c4..748f20a 100644 --- a/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs +++ b/OpenSim/ApplicationPlugins/Rest/Inventory/Rest.cs @@ -444,15 +444,9 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory public static string Base64ToString(string str) { - UTF8Encoding encoder = new UTF8Encoding(); - Decoder utf8Decode = encoder.GetDecoder(); try { - byte[] todecode_byte = Convert.FromBase64String(str); - int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length); - char[] decoded_char = new char[charCount]; - utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0); - return new String(decoded_char); + return Util.Base64ToString(str); } catch { -- cgit v1.1