Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Symbol font



Michael Hall wrote:

>Output to my testing applications JTextArea with or without the Symbol font
>System.out.println("\u2229");
>seems to show - ? , just question mark

What does System.out refer to?

If it's a file, as in shell redirection, and the default "file.encoding" is
MacRoman, then you will inevitably get a question mark.  That's because
your default text encoding is MacRoman, and MacRoman doesn't have a
code-point for that Unicode char.

If it's a Terminal.app window, and the file encoding is still the default
MacRoman, it will also fail, for the same reason.

If you change Java's default file encoding to something compatible with
Unicode, e.g.:
  java -Dfile.encoding=utf-8 ...
then it should write UTF-8 to a redirected stdout file.  You will then have
to open the file in a text editor that knew to use UTF-8.

If you change Java's default encoding and don't redirect stdout to a file,
i.e. view the output in a Terminal shell window, then Terminal.app can show
the right glyph, but only if its window settings are correctly setup first.


To setup Terminal.app to display UTF-8 correctly:

On 10.4:
  1) From Terminal menu, choose Window Settings... item.
  2) A "Terminal Inspector" floating palette appears.
  3) Choose Display from popup.
  4) A pane with "Cursor Style", "Text", and "Character Set Encoding" appears.
  5) Choose "Unicode (UTF-8)" from "Character Set Encoding" popup.
  6) Optional: click "Use Settings as Defaults" button.

On 10.5:
  1) From Terminal menu, choose Preferences... item.
  2) A window appears.
  3) Click the Encodings icon in its toolbar.
  4)  Ensure checkbox on Unicode UTF-8 is checked
  5) Click the Settings icon in toolbar.
  6) Click the Advanced tab in pane that appears.
  7) Under "International" section, choose "Unicode (UTF-8)".
  8) Optional: check "Set LANG environment var on startup" checkbox.

  -- GG


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.