Right to left isolate string

I am facing a tough problem with Farsi unicodes.

I have an std::wstring s = (L"\u0634\u0646\u0628\u0647"); which is a Farsi word. When I debug it, I see that the underlying word is exactly what I want, but reversed. So I have researched and found that u2067 is for right to left reading the string.

NOTE:

I cannot reverse the string manually because Farsi characters are changing their shape regardless of their position in the string.

So I added the 2067 int the beginning and got

std::wstring s = (L"\u2067\u0634\u0646\u0628\u0647");.

But now the underlying string is the same, just added a square in the beginning if the string instead of reversing.

Does anyone have experince with this stuff? Please suggest a solution. Thanks!
Try \u202B (RLE: right-to-left embedding) at the start of the string and \u202C (PDF: pop directional formatting) at the end.

Source: https://www.w3.org/International/questions/qa-bidi-unicode-controls
Last edited on
Topic archived. No new replies allowed.