I have a very old program (not a server or something on the internet) that I think it use the ANSI (Windows-1252) encoding. The problem is that some inputs to this program are written in Arabic.
However, when I am trying to read the result, the Arabic words are written with very wired character. For example the input: "نور" is converted to "äæÑ".
The program output should contain a combination of English words and Arabic words. E.x. It outputs "Name äæÑ" while the correct output should be something like "Name نور". In general, the English words are correct and readable with both UTF-8 and ANSI. But the Arabic words are read for example as "���" with UTF-8 and as "äæÑ" with ANSI.
I understand that this is because ANSI doesn't have support to non-Latin letters. but what should I do now? How can I convert them to Arabic again?
Note: I know the exact input and the exact output that this program should produce. Note2: I don't have the source code of this program. I just want to convert the output file of this program to have the correct words or encoding.
I solved this problem now by typing in the terminal:
iconv -f WINDOWS-1256 -t utf8 < my_File.ged > result.ged
I tried to write code in java that do a similar thing but it wasn't really working with giving my the result I wanted.
I have also tried the previous terminal command but using WINDOWS-1252
instead of WINDOWS-1256
but it wasn't working. So, I guess it is good to try different encoding until it is working