Pound (Sterling) sign in console app.

Posted on 2005-04-08
Last Modified: 2008-02-01
Hi all,

I've just begun learning Java and seem to be having a problem with character encoding. It's essentially the same issue as was covered here:

Except that the fix in that thread, the command 'chcp 1252', hasn't made any difference.

I'm in the UK, so I can type the Pound sign natively into any app. such as the Notepad++ I use for coding.
But when I run the Java app. that uses it (a simple console string-manipulation thing), I always get the wrong character.
I found two Unicode values for the symbol:

\u00A3 - gives a lowercase 'u' with acute accent
\u20A4 - gives a question mark (?)

Typing the character natively into the program gives me the 'u'. In fact, after chcp 1252, that's what I get if I type the same key in the console.

Notepad++ has the option to encode the .java source file as UTF-8, but if I do this I get compiler errors for characters at the very start of the file (where I can't actually see any characters - 'public....' should be right at the start) and the character that's displayed is still wrong.

Any idea how I can remedy this? Thanks in advance.
Question by:Havin_it
    LVL 86

    Accepted Solution


    chcp 1252

    do the following:

    1. Right-click the title bar of the console window
    2. Choose properties
    3. Choose 'Lucida Console' as the font


    LVL 10

    Author Comment

    Sorted! Can't believe I ignored that part.

    Easiest points you ever made?
    LVL 86

    Expert Comment


    >>Easiest points you ever made?

    No, the whole manoeuvre (although you knew most of it already, and the worst bits) is actually quite obscure ;-)

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    MaxSpan challenge 9 50
    maven java path setting 5 31
    java  and programming certification ? 4 29
    JAVA part two 4 10
    INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now