Bug 1801693 Comment 1 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Here's how I tested on a Mac:
1. Download a Hebrew version of Nightly
2. Enable `showSearchTerms.featureGate`
3. Switch my keyboard to Hebrew
4. Type either a set of non-numeric Hebrew characters or Hebrew characters with a number
5. Do a search

While using a mixture of text and numbers, I found the search term matches the ordering of characters in a search results page.

I found it's only when the search consists entirely of numbers that the term in the urlbar doesn't match.

After some digging, it's because in SearchEngine, we call `Services.textToSubURI.ConvertAndEscape(this.queryCharset, data)` which gives us a string that isn't reversed if the `data` consisting of only numbers.
Here's how I tested on a Mac:
1. Download a Hebrew version of Nightly
2. Enable `showSearchTerms.featureGate`
3. Switch my keyboard to Hebrew
4. Type either a set of non-numeric Hebrew characters or Hebrew characters with a number
5. Do a search

While using a mixture of text and numbers, I found the search term matches the ordering of characters in a search results page.

I found it's only when the search consists entirely of numbers that the term in the urlbar doesn't match.

After some digging, it's because in SearchEngine, we call `Services.textToSubURI.ConvertAndEscape(this.queryCharset, data)` which gives us a string that isn't reversed if the `data` consists solely of numbers. 

That makes sense because the function can't infer that the string should be reversed without giving it additional context, namely characters from a particular bidirectional language.
Here's how I tested on a Mac:
1. Download a Hebrew version of Nightly
2. Enable `showSearchTerms.featureGate`
3. Switch my keyboard to Hebrew
4. Type either a set of non-numeric Hebrew characters or Hebrew characters with a number
5. Do a search

While using a mixture of text and numbers, I found the search term matches the ordering of characters in a search results page.

When the search consists entirely of numbers, the term in the urlbar won't match.

After some digging, it's because in SearchEngine, we call `Services.textToSubURI.ConvertAndEscape(this.queryCharset, data)`. It does a conversion of the characters into a UTF-8 string. The difference is we encode a pure number string in the same order as they are input since there's nothing to suggest otherwise, whereas the the search engines encode the numbers in reverse.

Back to Bug 1801693 Comment 1