Unicode library
After all that (and the fact that this research started to get old) I went to read to sources of a library that does text processing and displaying it.
Long story short, this library imported a library that had a list of unicode characters that should be inverted (rtl), and a reference to the unicode bidi specification.
I finally found it! I can go to rest now.