Re: Charset?

From: Thomas Weidenfeller (nobody_at_ericsson.invalid)
Date: 07/30/04


Date: Fri, 30 Jul 2004 15:35:08 +0200

Viktor Lofgren wrote:
> Is there a way to set the charset of the swing widgets (just JTextField
> and JTextPane would do as well)? Currently all extended characters are
> rendered as square "boxes".

Java (including Swing) only uses one charset: Unicode. If you don't get
your characters displayed, then usually one of the following has happened:

        - You didn't use the appropriate charset conversion from an external
charset to Java's internal unicode. Your Java Strings and chars are
trashed due to the missing/wrong conversion. You will not only have
display problems, but other character and string related methods can
fail in mysterious ways (e.g. sorting).

        - You are using a font which doesn't have the necessary glyphs to
display the particular characters. Change to a font with the necessary
glyphs.

More unlikely reasons are

        - A trashed Java installation where e.g. the font.properties file is
trashed

        - A trashed OS, e.g. trashed OS font data

BTW: "extended characters" is a meaningless term.

/Thomas



Relevant Pages

  • Re: The Modernization of Emacs: terminology buffer and keybinding
    ... alphabets into a character set of 256 characters for a text-mode ... That lets you fit wide characters into ASCII with an encoding. ... one or one that can only display a subset of Unicode at a time, ... screen displays one of 256 glyphs from a charset page of memory. ...
    (comp.lang.java.programmer)
  • Re: Chinese, Japanese font issues with mail
    ... that too with no issues relating to display of characters, ... whatever charset etc. you want in meta tags. ...
    (comp.lang.php)
  • RE: traping curly apostrophes
    ... database, and these data will be displayed again on the webform later. ... you found that there are some particular characters which will be ... Based on my experience, this is likely a charset conversion issue, and "?" ... In the display page, you can set breakpoint in the page code and lookup ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: accentuation mark
    ... hang on to a prviously declared non-ISO-8859-1 charset. ... If you have read an e-mail that declares ISO-8859-2, ... screen as ISO-8859-1 characters, but if you then edit the ... read it fine in my UTF-8 news client. ...
    (comp.sys.acorn.misc)
  • Re: File Creation From Form
    ... The problem is if the user type in ... Handling anything more than us-ascii characters on HTML forms input is ... Don't put another CGI script anywhere near the public WWW until you've ... tell CGI.pm what charset you intend to use ...
    (comp.lang.perl.misc)