could you help me out on a question? My code is not passing accent to the text file, even passing the encoding. (I'm reading it in notepad)
Scanner in = new Scanner(System.in);
private String texto;
public void escrever(){
try{
PrintStream ps = new PrintStream("saida.txt","UTF-8");
for(;;){
System.out.print(">> ");
this.setTexto(in.nextLine());
if(texto.equals("::exit")){
System.out.print("Saindo...");
break;
}else{
ps.println(this.getTexto());
}
}
}catch(FileNotFoundException | UnsupportedEncodingException e){
System.out.println(e);
}
}
public String getTexto() {
return texto;
}
public void setTexto(String texto) {
this.texto = texto;
}
I apologize for any flaw here. I'm still learning how to use the site. Thank you in advance!