Netbeans Messing Up Accent

Asked

Viewed 3,814 times

3

For a few days now, I’ve noticed that Netbeans is changing accented characters in my code. Apparently, it only does this in the class that was opened when I closed Netbeans. That is, I am editing two classes and I close Netbeans. When reopened, the class that is in evidence (open) is with the accented characters messy.

FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Mês/Ano inválido!"));
  • Netbeans 8.0.1
  • Windows 7 64bits
  • Source code coding: UTF-8

What can it be?

  • Opa, right-clicking on your project, in the menu Properties, the encoding is also set to UTF-8?

  • Yeah, it’s also UTF-8

  • I noticed that these changes occur only in Java classes, XHTML does not. I noticed tmb that when I open the Netbeans IDE and notice that the accents have been changed, I can close the class and restart the Netbeans IDE and reopen the class that the code with wrong accents was not "saved"

  • Dude, really weird. One possible attempt is to delete the folder %HOMEPATH%\.nbi (this will reset the Netbeans settings), maybe even reinstall the IDE or do a downgrade. Another thing is to try to erase any specific Netbeans proprietary files in the Project and "reimport" the project code inside. This looks like a corrupted configuration or some plugin that soured the IDE.

  • 2

    Have you tried setting the charset to UTF-8 in the Netbeans configuration file? If I’m not mistaken just add the parameter -J-Dfile.encoding=UTF-8 in the option netbeans_default_options inside the archive $DIRETORIO_NETBEANS/etc/netbeans.conf.

  • Some other directories that are good candidates to be deleted %HOMEPATH%\AppData\Local\NetBeans\Cache and %HOMEPATH%\AppData\Roaming\NetBeans.

  • @gabrielhof It looks like you killed the riddle! Thank you tmb to Anthony Accioly

  • Hehe, put the answer to people with this same problem :D

Show 3 more comments

1 answer

4


According to the @gabrielhof tip, I added the parameter -J-Dfile.encoding=UTF-8 in the option netbeans_default_options of the Netbeans configuration file $DIRETORIO_NETBEANS/etc/netbeans.conf

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true -J-Dfile.encoding=UTF-8"
  • Really works.

  • In addition to adding the above parameter, I also installed an updated version of the netbeans HTML viewer downloaded from this link: http://plugins.netbeans.org/download/plugin/3675

  • I was also having the same problem, inserting this line in the solved configuration file, thank you guys!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.