During one project I worked on, we started seeing odd effects in Right-To-Left (rtl) languages, such as Hebrew. The sort of thing we were seeing was that on our Israel (Hebrew) website, the string "Home Advisor (UK)" was being rendered as ")Home Advisor (UK". Now, this string is meant to be rendered left-to-right, of course, and the latin characters were being - it was just those braces that were going wrong.
This was being caused by the Unicode bidirectional algorithm. And more than that, it’s even working as it's supposed to, so it was our content that was the problem...
Fortunately, one of our team had the book "Unicode Demystified" by Richard Gillam, which said that "If a conflict arises - that is, if a neutral is flanked by characters of opposite directionality - then the overall directionality of the paragraph wins."
This appeared to be what was happening - a character of neutral directionality (in our case, the closing parenthesis), has left-to-right characters preceding it ("UK"), and right-to-left characters following it (the rest of the document, being set to rtl as default). It therefore takes the rtl direction, and gets rendered at the beginning of the sentence.
The book continues, "Unicode provides a few other invisible formatting characters that can be used to control bidirectional layout. [...] The left-to-right override (U+202D) and right-to-left (U+203D) characters force all of the characters that follow them to be treated as strong left-to-right and strong right-to-left characters, respectively. The pop-directional-formatting character (U+202C) cancels the effect of the other two, returning the bi-di algorithm to its normal operation."
We could therefore use this as follows:
<html>
<body dir="rtl">
<!-- Force LTR, then off again -->
<p>‭Home Advisor (UK)‬</p>
<!-- Force RTL, then off again -->
<p>‮Home Advisor (UK)‬</p>
<!-- Default -->
<p>Home Advisor (UK)</p>
</body>
</html>
This, unfortunately, meant changes to the content we were getting from the database, to include the overrides, but at least it was an achievable solution.