Fix crash when searching for non-ASCII
This commit is contained in:
@@ -548,7 +548,10 @@ class BrowserViewController: UIViewController, WKNavigationDelegate, WKUIDelegat
|
|||||||
tab.beginLoadingURL(url)
|
tab.beginLoadingURL(url)
|
||||||
} else {
|
} else {
|
||||||
// Assume google search
|
// Assume google search
|
||||||
let queryString = text.replacingOccurrences(of: " ", with: "+")
|
let queryString = text
|
||||||
|
.replacingOccurrences(of: " ", with: "+")
|
||||||
|
.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
|
||||||
|
|
||||||
let searchURL = URL(string: "https://google.com/search?q=\(queryString)&gbv=1")! // gbv=1: no JS
|
let searchURL = URL(string: "https://google.com/search?q=\(queryString)&gbv=1")! // gbv=1: no JS
|
||||||
tab.beginLoadingURL(searchURL)
|
tab.beginLoadingURL(searchURL)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user