Re: Can't Get Pound Sign
22/01/2018 12:08
When I display the character set from 'u0000' to 'u00FF' there is no £ (pound) sign.

Character 'u0023' appears as # in my console window. My Keyboard is set to English
(United Kingdom). When I type a £ at the command prompt, it appears as a £, but when I
try to write a Java statement such as:

System.out.println(£);
and run it, it appears as a u with an acute (Hex character 'u00A3'). I tried using the
cmd command but it doesn't recognise this command. What, if anything, can I do?
PS I can get the £ sign in frames, but I would like to be able to use it in the CLI.

Can anybody help?

Source is Usenet: comp.lang.java.help
Sign in to add a comment

Answer score: 5
22/01/2018 12:08 - I'm using the Java 2 Platform Standard Edition,Version 1.5.0 (1.5.0_06);I've written many Java applications, some of them CLI apps, most of them using frames, also a few Applets of varying complexity; I've read David Heller's Ground-up Java, and also Core Java Volume 1; I've also gleaned ideas from Java source code freely available on the net.


It's just this blessed £ (pound) sign I'm having difficulty with on the command line interface. As a simple example,
import java.awt.*;import java.text.*;import java.util.*;
public class CurrencyTest3 { // see p59 Core Java Vol 1 static double x=100; public static void main(String[] args) { NumberFormat formatter = NumberFormat.getCurrencyInstance(Locale.UK); System.out.println(formatter.format(x)); System.out.println(£); }}
The output of this program? U guessed it:
<strange u symbol here>100.00<strange u symbol here>Does the (American) Java SDK/JRE not support English symbols?

Source is Usenet: comp.lang.java.help
Sign in to add a comment

Answer score: 5
22/01/2018 12:08 - Thanks for ur suggestion. I tried System.out.println('u20A4');but just got a ? (question mark)

Source is Usenet: comp.lang.java.help
Sign in to add a comment

Answer score: 5
22/01/2018 12:08 - Thanks for your help. I don't know what Wassup is, but I will look into encodings; possibly some online tutorials or peruse my local library. Once again, thank you. I'll give this a break now!

Source is Usenet: comp.lang.java.help
Sign in to add a comment

Answer score: 5
22/01/2018 12:08 - On Mon, 20 Mar 2006 23:03:36 +0000 (UTC), Chris Clarke<chris.clarke2004@btinternet.com> wrote, quoted or indirectly quotedsomeone who said :

In Unicode, British pound sign £ is u20a4'
That is the coding scheme you use internally. You will read anInputStreamReader to convert from whatever encoding you are using nowto translate.
see http://mindprod.com/applets/fileio.htmlfor sample code.


When your run wassup what does it say your default encoding is?
see http://mindprod.com/applets/wassup.html

Source is Usenet: comp.lang.java.help
Sign in to add a comment

Answer score: 5
22/01/2018 12:08 - On Tue, 21 Mar 2006 00:20:15 +0000 (UTC), Chris Clarke<chris.clarke2004@btinternet.com> wrote, quoted or indirectly quotedsomeone who said :

I gave you the URL earlier http://mindprod.com/applets/wassup.html
The problem is fonts and encodings interact in not entirely simpleway. If you want to solve this without learning that backgroundmaterial, you will have to follow instructions carefully.


So run wassup and report what it says about your file.encoding
Then run http://mindprod.com/applets/fontshower.htmland see if any of your installed fonts fail to show the pound signcorrectly.


Source is Usenet: comp.lang.java.help
Sign in to add a comment

Answer score: 5
22/01/2018 12:08 - On Mon, 20 Mar 2006 23:35:12 +0000 (UTC), Chris Clarke<chris.clarke2004@btinternet.com> wrote, quoted or indirectly quotedsomeone who said :

see http://mindprod.com/jgloss/encoding.html
you need some background.


Source is Usenet: comp.lang.java.help
Sign in to add a comment

Answer score: 5
22/01/2018 12:08 -
Roedy Green <my_email_is_posted_on_my_website@munged.invalid> wrote in message news:tliu12tjv13sm2c36dqnfhbhaaiunalm39@4ax.com...


In case it isn't clear, when Roedy tells you to run Wassup, he means you should use your web browser to navigate to the page http://mindprod.com/applets/wassup.html, which contains an embedded applet called Wassup. That's the applet he's trying to get you to run.


When I went to that page, it asked me if I would trust the applet, and I said No. The applet managed to gain SOME information about my system, but it did not say anything about encoding, so I guess I was supposed to say Yes to see the encoding info. The output when I run the applet looks like this:

<quote>browser = sun.pluginbrowser.version = 1.1file.separator = java.class.version = 49.0java.specification.name = Java Platform API Specificationjava.specification.vendor = Sun Microsystems Inc.

java.specification.version = 1.5java.vendor = Sun Microsystems Inc.

java.vendor.url = http://java.sun.com/java.version = 1.5.0_06</quote>
And so on.


- Oliver

Source is Usenet: comp.lang.java.help
Sign in to add a comment

Answer score: 5
22/01/2018 12:08 - On Mon, 20 Mar 2006 23:53:42 +0000 (UTC), Chris Clarke<chris.clarke2004@btinternet.com> wrote, quoted or indirectly quotedsomeone who said :

As I said, you need to some background to understand the problem. Youwon't run Wassup for me so I can't help further.
Again, if you want to crack this you will need to understandencodings. It is NOT like C. http://mindprod.com/jgloss/encoding.html

Source is Usenet: comp.lang.java.help
Sign in to add a comment

eDiscover
Helpforce eDiscover provides technical articles updated each dayHelpforce eDiscover RSS feed contains the latest technical articles in RSS
Click the logo to go back to the main page
Search eDiscover
  
Categories

Click an icon to go to that category

Helpforce eDiscover contains articles about Microsoft Windows Helpforce eDiscover contains articles about Apple products and MacOS Helpforce eDiscover contains articles about Linux and POSIX operating systems Helpforce eDiscover contains articles about Helpforce Helpforce has a large variety of technical information and articles for you to read Helpforce eDiscover contains articles about databases, MYSQL, SQL Server Oracle Helpforce eDiscover contains articles about Java, JVM and the JRE Helpforce eDiscover contains articles about the QNX operating system Helpforce eDiscover contains articles about Oracle Solaris and Open Solaris Helpforce eDiscover contains articles about RISC OS, Acorn and the BBC Micro Helpforce eDiscover contains articles about Amiga and AmigaOS

Type your comment into the box below