Repository navigation
Fix #2672: Use Uri.encode instead of URLEncoder for custom search queries - #2675
jahnaviNallavalli wants to merge 1 commit into
Conversation
|
@jahnaviNallavalli How was this tested and verified? Wich OS and browser? |
|
Hi @marunjar, To be transparent, I haven't run this on a physical device or emulator yet. The fix was prepared via code inspection based on issue #2672: URLEncoder.encode() is meant for HTML form data (application/x-www-form-urlencoded), converting spaces to +. When parsed via Uri.parse() and launched via Intent, certain browsers (like Chromium/Vanadium mentioned in the issue) escape that + into %2B, causing the search field to display literal plus signs. Replacing it with Android's Uri.encode() encodes spaces to %20 directly. I can set up a local build to test on a device/emulator if required, or if you already have the test environment running, I'd appreciate your feedback on the behavior! |
|
Thanks, but not needed anymore. |
Fixes #2672
Description
Replaces
URLEncoder.encode()withUri.encode()when interpolating query parameters into custom search provider URLs.Using
URLEncoderturns spaces into+, causing downstream intent handlers and browsers (such as Chromium/Vanadium) to re-encode the+into%2B, resulting in literal plus signs in search inputs.Uri.encode()applies standard percent-encoding (%20), ensuring correct whitespace parsing.