I am trying to write a feature involving translating multilingual text, with bidirectional problems (i.e English words within a Hebrew sentence)
When ordering the text in the right way (after translating), we need to convert it to ascii (regular python str), to use the push notification services of apple and google.
The problem is when converting from unicode to ascii, the string is unordered (the words themselves, not the internal chars order inside the words).
is there a way making sure, that the conversion (unicode -> ascii) will result the proper word ordering?
str1 ='Group1 \xd7\x94\xd7\xa6\xd7\x98\xd7\xa8\xd7\xa3 \xd7\x9c zlatan'
str2 =' \xd7\xa9\xd7\x9c\xd7\x97 \xd7\x94\xd7\x95\xd7\x93\xd7\xa2\xd7\x94'
print str2 + '.' + str1
the console output will be:
.zlatan Group1 .
as you can see the words 'Group1' and 'zlatan' got switched, as well as the sentences order