* Refactored out and de-duplicated Base64ToString(string)

* Fixed minor typo
This commit is contained in:
lbsa71
2009-03-31 05:51:28 +00:00
parent 20e1a8d7f6
commit fb9a358b79
4 changed files with 27 additions and 25 deletions

View File

@@ -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
{