Live data from Hacker News

Google can search backwards

google.com

11–20 of 29 posts

Re: Google can search backwards

#11
post #3

This is a trick with Unicode RTL. The search query in the URL contains the character U+202E RIGHT-TO-LEFT OVERRIDE, followed by the searched-for text in normal (nonreversed) order. Apparently Google ignores this character when searching for matches (so the matches are displayed normally), but the character appears when the query is reproduced in the search box at top of the screen, so the search string appears backwa…

Unicode Bidirectional Algorithm: http://www.unicode.org/reports/tr9/

Re: Google can search backwards

#12
This is not working for any other texts that I tried. Any reason why?

sdrowkcab hcraes nac elgooG

egap siht etalsnarT

tnahC aykanahC

lortnoc txet lanoitceridiB

weiver koob a

yhw nosaer yna

All I get are results from elgoog.rb-hosting.de or none at times!

Re: Google can search backwards

#16
post #3

This is a trick with Unicode RTL. The search query in the URL contains the character U+202E RIGHT-TO-LEFT OVERRIDE, followed by the searched-for text in normal (nonreversed) order. Apparently Google ignores this character when searching for matches (so the matches are displayed normally), but the character appears when the query is reproduced in the search box at top of the screen, so the search string appears backwa…

This character is interesting, one more thing to watch out for in user-provided input. You do your homework and escape HTML in users' comments but if you don't escape the RTL overrides, their effects can "bleed" to other parts of the page, rendering it unreadable or at least hard to read.

Re: Google can search backwards

#20
Not only that, Google also does keyboard-layout mapping if you forgot to switch your keyboard layout before searching.

For example, if I want to search in Hebrew for "חיפוש בעברית" but accidentally typed in English and typed "jhpua gchcr," (same keys as the Hebrew chars) - I'll still get the results I was looking for [1].

[1] - https://www.google.com/search?q=jhpua%20cgcrh,

Post reply on HN