The [
code]...[
/code] tags cannot handle your arabic characters correctly. This is how it looks without the tags (and I guess this is what you have written in your editor):
ahmednadi wrote:Str1=string::replaceAll(Str," ب "," ب"),
Str2=string::replaceAll(Str1," ل "," ل"),
Str3=string::replaceAll(Str2," و "," و"),
I guess the problem can be
reading direction. Unicode have some mechanism for switching between left-to-right and right-to-left reading direction based on the charactes in use. Some Windows routines utilize these mechanism, but other things doesn't.
As example the
sciLexer editor have a problem on that account, because Windows will write the text using the reading direction order, but the editor actually think that everything is layed-out left-to-right. So what you see on the screen may not actually correspond to what is in the file.
It it is such a problem it can be in one or more ofht following places:
- The input can be different than you thought
- Your code can be different than you thought
- The thing you use to view the result in can behave different than you thought
You can control the code by using \uXXXX instead of writing the arabic letters directly in the editor:
Code: Select all
Str1=string::replaceAll(Str," \u0628 "," \u0628"),
Str2=string::replaceAll(Str1," \u0644 "," \u0644"),
Str3=string::replaceAll(Str2," \u0648 "," \u0648"),
(Notice that XXXX in \uXXXX must be four hexadecimal digits. I believe, I have recalculated the the ones used in your example to the proper hex values).
But that only fix bullet 2. I don't know how to deal with bullet 1 and 3.