A very basic problem that I've encountered in a project and it reoccured in this basic code:
import java.util.Scanner;public class Special { public static void main(String[] args) { System.out.println("Donner le mot"); Scanner sc = new Scanner(System.in, "UTF-8"); String w = sc.next(); System.out.println(w); }}
So I insert a string containing normal alphabetic letters and accented letters that are used in French (é,ç,ù...), the problem I faced is in the printed output which displays the normal letters as they are and prints an interrogation point "?" at the place of each accented letter.The compilation lines are those as usual:
javac Special.javajava Special
it's noteowrthy that I made sure to save the file in UTF-8 encoding format.