Netbeans UTF-8 encoding problem – ISO-8859-1

Issue

This Content is from Stack Overflow. Question asked by DanielLaz

I am looking for help with the coding problem in NetBeans 15 , jdk (the most recent) , I have several first and last names that have the letter “Ñ” . “é” I changed the encoding but still the problem remains, it is a finished project, when exporting it does all the functions but the letters come out weird, example, I enter a random name: Ricardo Nuñez Liñan, now when I give it in search I get Ricardo Nuñez Liñan. I want to know if you know a code that can change those letters by characters when searching, I tried another code but it does not come out, I attach a part of the code that I put in comment, if you know another similar method I will be happy to help me to solve the data, I save the data in notepad.
Imagen del NetBeans

The code I put to replace only the letter is :

          String str5 = TNombres.getText();
          String str6 = str5.replaceAll("ñ", "ñ");
          TNombres.setText(str6);

but if one has more than one special character I would like to change them all , for example : Ñahúi José , in this case also apply to the letter é and also the Ñ :(




Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?