mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-18 00:54:19 +00:00
Added code to properly escape non-ascii characters in URLs passed to the WebBrowserComponent on macOS/iOS
This commit is contained in:
parent
a554d0e95e
commit
1baaddb115
1 changed files with 8 additions and 1 deletions
|
|
@ -231,8 +231,15 @@ public:
|
|||
}
|
||||
else
|
||||
{
|
||||
NSString* urlString = juceStringToNS (url);
|
||||
|
||||
#if (JUCE_MAC && (defined (__MAC_OS_X_VERSION_MIN_REQUIRED) && defined (__MAC_10_9) && __MAC_OS_X_VERSION_MIN_REQUIRED >= __MAC_10_9)) || (JUCE_IOS && (defined (__IPHONE_OS_VERSION_MIN_REQUIRED) && defined (__IPHONE_7_0) && __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_7_0))
|
||||
urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
|
||||
#else
|
||||
urlString = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
||||
#endif
|
||||
NSMutableURLRequest* r
|
||||
= [NSMutableURLRequest requestWithURL: [NSURL URLWithString: juceStringToNS (url)]
|
||||
= [NSMutableURLRequest requestWithURL: [NSURL URLWithString: urlString]
|
||||
cachePolicy: NSURLRequestUseProtocolCachePolicy
|
||||
timeoutInterval: 30.0];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue