'Trying to import CSV containing Arabic characters to the website by Selenium - Java, but when the data upload to the website it shows like that (???)

Read the CSV file and how to format it, I'm trying to use Selenium with Java, to upload this file to the search fields, but this test is to show how the website will read the CSV file

package utiliites;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class CSV {
    
    // This method will read and return data from a CSV file
    public static List<String[]> get(String filename) {
        List<String[]> data = new ArrayList<String[]>();
        String testRow;
        try {
            // Open and read the file
            BufferedReader br = new BufferedReader(new FileReader(filename));
            // Read data as long as it's not empty
            // Parse the data by comma using .split() method
            // Place into a temporary array, then add to List 
            while ((testRow = br.readLine()) != null) {
                String[] line = testRow.split(",");
                data.add(line);
            }
        } catch (FileNotFoundException e) {
            System.out.println("ERROR: File not found " + filename);
        } catch (IOException e) {
            System.out.println("ERROR: Could not read " + filename);
        }
        return data;
    }

}

Read the CSV and here where is it showing like this (???)

package Test;

import java.util.List;

public class DataReadrs {

    public static void main(String[] args) {
        readCSV();
    }

    private static void readCSV() {
        String filename = "C:\\Users\\user\\Downloads\\Delegation(IdealLandData).csv"; 
        List<String[]>records = utiliites.CSV.get(filename);
        
        for (String[] record : records) {
            for (String field : record) {
                System.out.println((record[0]));
            }
            
        }
    }
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source