Won't display special characters in cmd.

  • HI :)

    I’d like to start my first post here by thanking you for all your hard work you’ve put into this great program :)

    Im literally just starting to learn how to program in Java, so please pardon me being a bit slow.

    Here is my problem:

    Cmd won’t display special characters (like “ó”) from my native language when i’m making a .java file in Notepad ++. I can see them well in the text editor itself, and also i can see them in cmd when using basic windows notepad using exact same code…
    I’ve tried playing around with different coding, but it’s either not showing special characters in editor or in cmd or cmd displays some “illegal character” errors.

    Halp please :(

  • Hi,

    the best way would be to avoid special characters in program code if possible.
    Nevertheless, with Java you do have a runtime switch -Dconsole.encoding
    which can be used to force a certain code page. E.g. -Dconsole.encoding=CP850
    (which seems to be the standard codepage of windows cmd).
    In addition you need to escape your special char like \u00F3 for “ó” (I guess).


  • @Aleksander-Zmorzyński did you try to use a different encoding ?

    e.g. Menu / Endocing / UTF-8 ?

    But you should really stick to english when writing code :)

  • Yeah, thats what friends told me “just avoid them” :)

    anyway, thanks for input :)