Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
[iOS] Fix <image> cannot display picture with url which contains Chin…
Browse files Browse the repository at this point in the history
…ese words. (#2135)
  • Loading branch information
NickeyLin committed Mar 11, 2019
1 parent bf88859 commit 2d98598
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ios/sdk/WeexSDK/Sources/Model/WXSDKInstance.m
Original file line number Diff line number Diff line change
Expand Up @@ -766,8 +766,12 @@ - (NSURL *)completeURL:(NSString *)url
if (!url) {
return nil;
}

return [NSURL URLWithString:url relativeToURL:_scriptURL];
NSURL *result = [NSURL URLWithString:url relativeToURL:_scriptURL];
if (result) {
return result;
}
// if result is nil, try url-encode the 'url' string.
return [NSURL URLWithString:[url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding] relativeToURL:_scriptURL];
}

- (BOOL)checkModuleEventRegistered:(NSString*)event moduleClassName:(NSString*)moduleClassName
Expand Down

0 comments on commit 2d98598

Please sign in to comment.