Currently, I add a pound sterling (£) sign to the Java source and compile the resulting Swing component shows as the square (unsupported character) symbol.
I suspect it's an encoding problem, the Java source file is encoded as cp1252 (Eclipse seems to default to this). What's the correct way of resolving this?
Use the \u00A3 notation. Further examples here for the unicodes Unicode code points for other symbols.
I believe you can change the source code's encoding from Eclipse (or from any decent editor). Set it to UTF-8. Then everything should behave smoothly, because Java Strings are Unicode.
I would strongly encourage using proper encoding in the source, instead of this \uXXX notation. The reason being, how on earth do you infer form the code what for instance \u00A3 means? It's much clearer to just put the correct character there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With