public class ExampleEuroPound {

    public static void main(String args[]){

        String euro = "\u20ac";
        String pound = "\u00a3";

        System.out.println("pound = " + pound);
        System.out.println("euro = " + euro);
    }
}
Answer from Boris Pavlović on Stack Overflow
🌐
TutorialsPoint
tutorialspoint.com › home › java/util › java currency get symbol
Java Currency Get Symbol - TutorialsPoint
September 1, 2008 - The following example shows the usage of Java Currency getSymbol() method for default locale. We've first created a currency object using EUR as currency code and then its symbol is printed.
🌐
Quora
quora.com › If-I-want-to-insert-the-euro-symbol-in-Java-I-write-String-euros-u20ac-What-about-dollar-symbol-and-yen-symbol
If I want to insert the euro symbol in Java I write: String euros = '\u20ac'. What about dollar symbol and yen symbol? - Quora
Answer (1 of 2): Go here. Really cool site where you can search codes or symbol names. For example, type 20ac in the search on the middle right side. See the Euro come up? That’s the Unicode Number, which means the character is ‘\u20ac’. Whatever code you find there can be used in the same way.
Top answer
1 of 2
8

If the question is just about the Euro sign getting garbled—that is, the program

import java.io.*;

public class Foo {

    public static void main (String args[])
        throws Exception
    {
        System.out.println("\u20ac");
    }
}

Then, first you must read The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!).

Then you need to make the encoding that Java sends out match the encoding expected by the thing displaying Java’s output. I’m assuming you’re working at a command line.

  • On Linux this should just work. Everything is UTF-8 by default.

  • On the Mac, in Terminal.app, this won’t work because for some ridiculous reason the default text encoding for Java is the ancient MacRoman character set [Update: this shouldn’t still be a problem, I believe the default was fixed starting with Java 7] which doesn’t have the Euro. But Terminal.app totally supports UTF-8. Technically you can turn that off in Terminal → Preferences → Settings → Advanced → International, but it’s UTF-8 by default.

To set java to use UTF-8 output, you can pass the command line argument

    java -Dfile.encoding=UTF-8 Foo

But that only works if you can control the startup of your program. If you’re sending JARs or .class files for others to run, that won’t work. You can set up the encoding yourself by creating an object that will write to System.out with a different encoding:

    import java.io.*;
    
    public class Foo {
    
        public static void main (String args[])
            throws Exception
        {
            PrintWriter out = new PrintWriter(
                new OutputStreamWriter(System.out, "UTF-8"), true);
    
            out.println("\u20ac");
        }
    }

So long as you remember to always use your new out variable for printing instead of System.out.

  • On Windows it gets crazier. The default encoding at the command prompt varies between different language versions of Windows. On the English version of Windows, it’s Cp850. On Russian Windows, it’s Cp866. Neither has the Euro symbol! You can change the encoding with the chcp command, but even if you change it to an encoding that does have the Euro symbol, the default command prompt font doesn’t have the Euro symbol!

You may be able to detect from Java that you are running at the Windows command prompt, change the encoding and font programmatically, and then output your string, but—that’s a lot of work. You’re probably better off just using the above code to force UTF-8 output, and include instructions with your code that if it is to be run at the Windows command prompt, that the user will first need to:

1. Run `chcp 65001` to switch the command prompt encoding to UTF-8
2. Switch the font to Lucida Console by clicking the icon in the upper left corner, selecting Properties, and going to the Font tab.

To make things easier for you, but to increase the chances that the code you write will work on your computer only, you can also change the default command prompt code page to UTF-8.

2 of 2
2

If the output is garbled, rather than a Euro sign, it's probably a problem with the console where you are running the program. Make sure it's capable of printing € and that the default character encoding for the platform matches the console's character encoding.

🌐
W3Resource
w3resource.com › java-tutorial › util › currency › java_currency_getsymbol.php
Java Currency Class: getSymbol() Method - w3resource
import java.util.*; public class ... the symbol of the currency String symbol = cur1.getSymbol(locale); System.out.println("Currency symbol is = " + symbol); } } Output: Currency symbol is = € · Java Code Editor: ...
🌐
Tabnine
tabnine.com › home page › code › java › java.util.currency
java.util.Currency.getSymbol java code examples | Tabnine
System.out.println( Currency.getInstance("USD").getSymbol(Locale.US) ); // prints $ System.out.println( Currency.getInstance("USD").getSymbol(Locale.FRANCE) ); // prints USD System.out.println( Currency.getInstance("EUR").getSymbol(Locale.US) ...
🌐
Stack Overflow
stackoverflow.com › questions › 56869168 › java-how-to-print-euro-symbol-on-an-receipt-printer
printing - Java: How to print Euro symbol on an receipt printer - Stack Overflow
July 3, 2019 - String euro = "\u20ac"; PrinterService ps = new PrinterService(); String toPrint = new String(); toPrint = ("Hello world, 5" + euro); ps.printString(printer, toPrint); ... Thing is, codepage 437 doesn't support euro, that's when your € becomes ...
🌐
Stack Overflow
stackoverflow.com › questions › 19314995 › how-to-display-currency-symbols-in-java-other-than-sign
How to display currency symbols in Java other than $ sign? - Stack Overflow
Found out that pound sign = 00A3 and Euro sign = \20AC. Came up with the following line of code and it still doesn't give me the currency signs. I am new to programming and Java. Thanks for advice. public class currency { public static void ...
Find elsewhere
🌐
TutorialsPoint
tutorialspoint.com › java › util › currency_getsymbol_locale.htm
Java.util.Currency.getSymbol( Locale locale ) Method
NullPointerException − if specified ... Currency.getInstance(locale); // get and print the symbol of the currency String symbol = curr.getSymbol(locale); System.out.println("Currency symbol is = " + symbol); } }...
🌐
Experts Exchange
experts-exchange.com › questions › 20997515 › Replacing-EURO-character-in-a-Java-String.html
Solved: Replacing EURO character in a Java String | Experts Exchange
May 21, 2004 - Have you tried this : s = s.replace((char)8364, '_'); where s is the string containing the euro charater and _ is whatever you want to replace it with ? ... nknown Source) : ¬ --> In hexadecimal : E2 82 AC which is the UTF-8 representation ...
🌐
Java Code Geeks
javacodegeeks.com › home › core java
Java Currency Code Symbol Mapping Example - Java Code Geeks
May 8, 2025 - For example, "USD" maps to "$", "INR" maps to "₹". Some entries, like "AUD" and "CAD", use prefixed symbols ("A$", "CA$") to disambiguate them from other dollar-based currencies. The main method calls the printSymbol method multiple times to retrieve and print the symbol for each currency code.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 207039355-Euro-sign-in-Java-applications
Euro (€) sign in Java applications
You have to specifiy the encoding also when compiling the class. It's better to encode the Euro-Sign. Greetings Marc Salm ... Hi, Thanks for the reply. The problem is not that the Euro symbol occurs somewhere in the code, but it is refused when entered by a user in a textfield and transmitted to the database.
🌐
GitHub
github.com › DantSu › ESCPOS-ThermalPrinter-Android › issues › 6
Not able to print euro sign € · Issue #6 · DantSu/ESCPOS-ThermalPrinter-Android
May 18, 2020 - You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. ... Hey, I'm using this great lib since a couple of months ago and I just figured out that I was not able to print the euro sign : '€'. This symbol is replaced by a question mark.
🌐
Educative
educative.io › answers › how-to-convert-the-currency-code-to-the-currency-symbol-in-java
How to convert the currency code to the currency symbol in Java
Next we use the getSymbol() method on the currency object to get the currency symbol. ... To get all the available currency codes, use the static getAvailableCurrencies() method of the Currency class.
🌐
Medium
medium.com › @samuelgbenga972 › simplifying-multi-currency-support-in-java-a-smarter-way-to-handle-currency-symbols-659535de61f4
Simplifying Multi-Currency Support in Java: A Smarter Way to Handle Currency Symbols | by Samuelgbenga | Medium
May 9, 2025 - import java.util.Currency; import ... currency.getSymbol(currentLocale); System.out.println("User Region: " + currentLocale.getCountry()); System.out.println("Currency Symbol: " + symbol); } }...
🌐
Stack Overflow
stackoverflow.com › questions › 34977949 › €-symbol-java-unicode
€ Symbol Java Unicode - Stack Overflow
The following code displays OK ... Test{ public static void main(String[] args) { String euro = "\u20ac"; String pound = "\u00a3"; System.out.println("pound = " + pound); System.out.println("euro = " + euro); } }...
🌐
Baeldung
baeldung.com › home › java › currency code to currency symbol mapping in java
Currency Code to Currency Symbol Mapping in Java | Baeldung
July 14, 2025 - Java offers multiple ways to map a currency code to its respective symbol, including the built-in Currency class, a hardcoded Map, and Locale support.