RTL Bugs


Take a look at the following text, looks normal enough doesn't it?

"Harry ‮".draziw a si ‭Potter

Now, try to select the text and see what happens.

WHAT WITCHCRAFT IS THIS?!

If you examine the source code for this page, you'll see that I'm using the Unicode Bi-Directional characters.

"Harry ‮".draziw a si ‭Potter

These characters are useful when writing text that includes, say, English and Arabic - but they can also be used for malicious purposes.

On a more mundane level, they can cause all sorts of UI bugs. I've just filed a bug against the Chrome browser for how it handles these characters.

If you right click on text with mixed direction, you'll notice that the UI behaves oddly.

Chrome RTL-fs8

In Firefox, the behaviour is correct - although one could argue whether "Potter" ought to be reversed.

Firefox RTL-fs8

Searching

So, what happens when we run these searches?

Chromium RTL Search-fs8
Firefox RTL Search-fs8

Neither Firefox nor Chrome do particularly well. I'm not sure if the reversed text in the window title and URL bar are bugs in Ubuntu - or whether it's the fault of the app itself.

On Windows and Mac, we see this happen:

Safari RTL-fs8
IE RTL-fs8

This would suggest that Google isn't correcting the direction of the text and that is deforming its own title tags.

Are These Bugs?

Ok, so having the title reversed isn't the worst problem in the world. But do these examples count as bugs and, if so, who is responsible for them?

Every search engine I tried passed through the right-to-left-over-ride unscathed - so that's the fault of the search engine, right? How the hell do you a report a bug to Google?

The title bar could either be a problem with the browser - Firefox has a bug report over a year old on the issue - or the problem could be with the underlying operating system. How would one find out?

Thanks

Thanks to Yuan Phoon for asking the questions which prompted this discovery.


Share this post on…

  • Mastodon
  • Facebook
  • LinkedIn
  • BlueSky
  • Threads
  • Reddit
  • HackerNews
  • Lobsters
  • WhatsApp
  • Telegram

What are your reckons?

All comments are moderated and may not be published immediately. Your email address will not be published.

Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <p> <pre> <br> <img src="" alt="" title="" srcset="">