Fix crash when searching for non-ASCII
This commit is contained in:
@@ -548,7 +548,10 @@ class BrowserViewController: UIViewController, WKNavigationDelegate, WKUIDelegat
|
||||
tab.beginLoadingURL(url)
|
||||
} else {
|
||||
// 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
|
||||
tab.beginLoadingURL(searchURL)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user