diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1583_1.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1583_1.cs new file mode 100644 index 000000000..8974f0064 --- /dev/null +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1583_1.cs @@ -0,0 +1,35 @@ +using Xamarin.Forms.CustomAttributes; +using Xamarin.Forms.Internals; + +#if UITEST +using Xamarin.UITest; +using NUnit.Framework; +#endif + +namespace Xamarin.Forms.Controls.Issues +{ + [Preserve(AllMembers = true)] + [Issue(IssueTracker.Github, 1583, "WebView fails to load from urlwebviewsource with non-ascii characters (works with Uri)", PlatformAffected.iOS, issueTestNumber: 1)] + public class Issue1583 : TestContentPage + { + protected override void Init() + { + var webview = new WebView + { + AutomationId = "webview" + }; + webview.Source = new UrlWebViewSource { Url = "https://www.google.no/maps/place/Skøyen" }; + + Content = webview; + } + +#if UITEST + [Test] + public void Issue1583Test () + { + RunningApp.WaitForElement (q => q.Marked ("webview")); + RunningApp.Screenshot ("I didn't crash and i can see Skøyen"); + } +#endif + } +} diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems index ee2d697f9..74912a098 100644 --- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems +++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Xamarin.Forms.Controls.Issues.Shared.projitems @@ -691,6 +691,7 @@ + @@ -859,7 +860,7 @@ Designer - MSBuild:Compile + MSBuild:UpdateDesignTimeXaml \ No newline at end of file diff --git a/Xamarin.Forms.Platform.iOS/Renderers/WebViewRenderer.cs b/Xamarin.Forms.Platform.iOS/Renderers/WebViewRenderer.cs index 5093c776c..e7109e045 100644 --- a/Xamarin.Forms.Platform.iOS/Renderers/WebViewRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Renderers/WebViewRenderer.cs @@ -79,7 +79,8 @@ namespace Xamarin.Forms.Platform.iOS public void LoadUrl(string url) { - LoadRequest(new NSUrlRequest(new NSUrl(url))); + var encodedStringUrl = new NSString(url).CreateStringByAddingPercentEscapes(NSStringEncoding.UTF8); + LoadRequest(new NSUrlRequest(new NSUrl(encodedStringUrl))); } public override void LayoutSubviews()