Click here to Skip to main content
15,610,660 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Input : D8B9D8B1D988D8B320D8A7D984D8BAD8B1D8A8
Output : دضبصدضب١دصضضدضبعء٠دضاحدصض٤دضبادضب١دضاض(In Arabic language),1 day, 4 days, 4 days, 1 times(In English Language).

Please suggest solution in java code only. Thanks in advance.

What I have tried:

Didn't get any solution till now.
Updated 1-May-20 0:48am
Richard MacCutchan 1-May-20 6:49am    
This looks like the same question you posted yesterday.

1 solution

You need to use some sort of translation service.

Java does not understand Arabic, nor English. That is a logical abstraction that will help you write the code that accepts Arabic String and would convert it to English String.

There are some online services (paid) and offline services (low-accuracy). You can check which one works better for you.

You can start with this library that offers a free trial: GitHub - aurasphere/jyandex: A Java library client for Yandex Translate service.[^]
Share this answer
@raj0072 1-May-20 12:11pm    
Thanks for the Reply @Afzaal Ahmad Zeeshan. But in Github solution i am not able to find out the Hex to arabic string conversion. And that is only my main concern to post the question here!.
Afzaal Ahmad Zeeshan 2-May-20 6:06am    
@raj0072 2-May-20 10:20am    
@Afzal I tried this also output is coming in this format "الايام الخالدة" and i checked on google translate this is detecting the english language but it is not giving the arabic string. Please share your thought on this.
Afzaal Ahmad Zeeshan 2-May-20 17:05pm    
That is because Arabic characters cannot come in ASCII code, you need to have Unicode for that. ASCII can only contain English characters.
@raj0072 3-May-20 0:59am    
is there any code example you can provide to do this? that one will be very helpful for me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900