0

Hello
I'm writing java code read arabic character but it don't show the text correctly it show squares Any one Can help me any help will be appreciated
Thanks

Yours
Ahmed Ghazey

6
Contributors
7
Replies
10
Views
6 Years
Discussion Span
Last Post by ahmaadaadel
0

Hello
I'm writing java code read arabic character but it don't show the text correctly it show squares Any one Can help me any help will be appreciated
Thanks

Yours
Ahmed Ghazey

Can I see your code please?

1

By Allah Willing I do it Thanks All and this is the code

public void unicodeShow(String fileName) throws UnsupportedEncodingException, FileNotFoundException, IOException{
        Reader reader = new InputStreamReader(new FileInputStream(fileName), "utf-8");
        BufferedReader br = new BufferedReader(reader);
        String a=br.readLine();
        System.out.println(a);
    }

by Ahmed Ghazey
FCI CU
Egypt

Edited by peter_budo: Adding code tags to old post

0

I see the thread is marked as solved.
If you have solved your problem, could you please post your solution so the next person with the same problem can find the solution here.
Thanks

0

Sorry I don't Understand you if You read my Comment You will see the Solution I put it when I get The Solution immediately
Thanks For Attention You are right but you must read all the Comments
Thanks Again
Yours
Ahmed Ghazey
FCI CU

0

It happends with Chinese characters as well. I think this is probably due to the computer system (windows' config) where your output is printed.

Edited by tong1: n/a

0

You can see the output in the any specific file, because some IDE not supported UTF-8 for text file encoding(Ex, in Eclipse go to the
Windows/Preferences/General/Workspace
In the Text file encoding
select in the Other the UTF-8 to change the encoding)

public static void writeTiFile(String fileName,String str){
        try {
            FileOutputStream out = new FileOutputStream(fileName);
            out.write(str.getBytes("windows-1256"));
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

Edited by peter_budo: Adding code tags to old post

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.