diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index cef756c66b..9227708834 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -409,19 +409,25 @@ namespace OpenSim.Framework
///
///
///
+
public static string Md5Hash(string data)
{
- byte[] dataMd5 = ComputeMD5Hash(data);
+ return Md5Hash(data, Encoding.Default);
+ }
+
+ public static string Md5Hash(string data, Encoding encoding)
+ {
+ byte[] dataMd5 = ComputeMD5Hash(data, encoding);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < dataMd5.Length; i++)
sb.AppendFormat("{0:x2}", dataMd5[i]);
return sb.ToString();
}
- private static byte[] ComputeMD5Hash(string data)
+ private static byte[] ComputeMD5Hash(string data, Encoding encoding)
{
MD5 md5 = MD5.Create();
- return md5.ComputeHash(Encoding.Default.GetBytes(data));
+ return md5.ComputeHash(encoding.GetBytes(data));
}
///
@@ -1161,7 +1167,7 @@ namespace OpenSim.Framework
public static Guid GetHashGuid(string data, string salt)
{
- byte[] hash = ComputeMD5Hash(data + salt);
+ byte[] hash = ComputeMD5Hash(data + salt, Encoding.Default);
//string s = BitConverter.ToString(hash);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 1ccf76e240..45af13a5cb 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -6939,7 +6939,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_String llMD5String(string src, int nonce)
{
m_host.AddScriptLPS(1);
- return Util.Md5Hash(String.Format("{0}:{1}", src, nonce.ToString()));
+ return Util.Md5Hash(String.Format("{0}:{1}", src, nonce.ToString()), Encoding.UTF8);
}
public LSL_String llSHA1String(string src)