Quantcast
Channel: Active questions tagged utf-8 - Stack Overflow
Viewing all articles
Browse latest Browse all 1052

Jave code replaces accented letters by interrogation points

$
0
0

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.


Viewing all articles
Browse latest Browse all 1052

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>