Bug 6597 - NSUrl construction fails with special unicode characters
Summary: NSUrl construction fails with special unicode characters
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.2
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2012-08-18 13:23 UTC by Bryan Moulton
Modified: 2013-12-05 18:34 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Bryan Moulton 2012-08-18 13:23:42 UTC
When trying to use the following code sample, the resulting NSUrl string is empty:
NSUrl unicodeUrl = new NSUrl("http://www.bing.com/images/search?q=雅詩蘭黛");

A solution is provided here, but the 'stringByAddingPercentEscapesUsingEncoding' function is not present in MonoTouch.

You also cannot construct an NSUrl from an NSString.
Comment 1 Sebastien Pouliot 2012-08-19 20:40:08 UTC
.NET provide it's own escaping/encoding methods* and, in general, we do not (by default) bind 'duplicate' things, i.e. that .NET already provide (it helps code portability). 

* HttpUtility.UrlEncode [1] which is also available in MonoTouch [2]

[1] http://msdn.microsoft.com/en-us/library/system.web.httputility.urlencode.aspx
[2] http://stackoverflow.com/q/5398072/220643

> You also cannot construct an NSUrl from an NSString.

You can use:

    var url = NSUrl.FromObject (new NSString (bug6597));

and the `url` won't be empty (but not tried).

Not sure if this totally solve your issue (at least NSUrl can be constructed ;-) so please close it or ask for more :-)
Comment 2 PJ 2013-11-19 17:04:21 UTC
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?

If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
Comment 3 PJ 2013-12-05 18:34:22 UTC
This bug has not been changed from the NEEDINFO state since my previous comment, marking as RESOLVED NORESPONSE.

Please feel free to REOPEN this bug at any time if you are still experiencing the issue. Please add the requested information and set the bug back to the NEW (or CONFIRMED) state.