From: <ba...@us...> - 2013-08-19 19:54:21
|
Revision: 4619 http://sourceforge.net/p/mp-plugins/code/4619 Author: bartev Date: 2013-08-19 19:54:19 +0000 (Mon, 19 Aug 2013) Log Message: ----------- Fixed UTF8 strings Modified Paths: -------------- trunk/plugins/VeraControl/VeraControl.csproj trunk/plugins/VeraControl/VeraHelper.cs Modified: trunk/plugins/VeraControl/VeraControl.csproj =================================================================== --- trunk/plugins/VeraControl/VeraControl.csproj 2013-08-19 19:50:54 UTC (rev 4618) +++ trunk/plugins/VeraControl/VeraControl.csproj 2013-08-19 19:54:19 UTC (rev 4619) @@ -73,6 +73,7 @@ <Reference Include="System.ServiceModel.Web"> <RequiredTargetFramework>3.5</RequiredTargetFramework> </Reference> + <Reference Include="System.Web" /> <Reference Include="System.Web.Extensions"> <RequiredTargetFramework>3.5</RequiredTargetFramework> </Reference> Modified: trunk/plugins/VeraControl/VeraHelper.cs =================================================================== --- trunk/plugins/VeraControl/VeraHelper.cs 2013-08-19 19:50:54 UTC (rev 4618) +++ trunk/plugins/VeraControl/VeraHelper.cs 2013-08-19 19:54:19 UTC (rev 4619) @@ -10,6 +10,9 @@ */ using System; using System.Xml; +using System.Text; +using System.Web; +using System.IO; namespace VeraControl.Properties { @@ -126,7 +129,10 @@ { return def; } - return xn.Attributes[key].Value; + + // Vera send UTF8 strings in ASCII format convert them to real UTF8 strings. + byte[] bytes = Encoding.Default.GetBytes(HttpUtility.UrlDecode(xn.Attributes[key].Value)); + return Encoding.UTF8.GetString(bytes); } public long GetSecondsSince1970() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |