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

Commit

Permalink
Merge pull request #2214 from NickeyLin/fix/image
Browse files Browse the repository at this point in the history
[iOS] Fix <image> can't display picture with url which contains Chinese words. (#2135)
  • Loading branch information
wqyfavor authored Apr 1, 2019
2 parents 591c684 + 2d98598 commit 450a27c
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 @@ -769,8 +769,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 450a27c

Please sign in to comment.