Http on iOS does not support UTF-8

I found that when trying to create an HttpRequest on iOS where one or more of the characters of the url is not ASCII the application crashes. My solution was to edit the HttpRequest.mm in the Fuse package folder.

HttpRequest::HttpRequest(
        @{Uno.Net.Http.HttpMessageHandlerRequest} unoRequest,
        uString method, uString url)
    : unoRequest(unoRequest)
    , requestTaskOrResponse(nil)
{
    NSString urlString = uString2NSString(url);
    // I Added this to support UTF-8
    urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];

    NSMutableURLRequest request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:urlString]];

    request.HTTPMethod = uString2NSString(method);

    requestTaskOrResponse_ = request;
}

Could you please add support for this in a future version?

Yes, we can :slight_smile: