All computer source code presented on this page, unless it includes attribution to another author, is provided by Ed Halley under the Artistic License. Use such code freely and without any expectation of support. I would like to know if you make anything cool with the code, or need questions answered.
python/
    bindings.py
    boards.py
    buzz.py
    caches.py
    cards.py
    constraints.py
    csql.py
    english.py
    getch.py
    getopts.py
    gizmos.py
    goals.py
    improv.py
    interpolations.py
    namespaces.py
    nihongo.py
    nodes.py
    octalplus.py
    patterns.py
    physics.py
    pids.py
    pieces.py
    quizzes.py
    recipes.py
    relays.py
    romaji.py
    ropen.py
    sheets.py
    stores.py
    strokes.py
    subscriptions.py
    svgbuild.py
    testing.py
    things.py
    timing.py
    ucsv.py
    useful.py
    uuid.py
    vectors.py
    weighted.py
java/
    CSVReader.java
    CSVWriter.java
    GlobFilenameFilter.java
    RegexFilenameFilter.java
    StringBufferOutputStream.java
    ThreadSet.java
    Throttle.java
    TracingThread.java
    Utf8ConsoleTest.java
    droid/
        ArrangeViewsTouchListener.java
        DownloadFileTask.java
perl/
    CVQM.pm
    Kana.pm
    Typo.pm
cxx/
    CCache.h
    equalish.cpp
Download Utf8ConsoleTest.java
/**
 * Demonstrate and explain Eclipse UTF-8 Console Problems.
 */
package cc.halley.kata.util;

import java.io.PrintStream;

public class Utf8ConsoleTest
{
        public static void main(String[] args)
        {
                PrintStream out = System.out;
                out.print("Japanese Hiragana 'A' looks like this: ");
                out.println("\u3042");
                
                /*
                 * If that didn't appear as a Japanese Hiragana 'A' character,
                 * which is a curvy character composed of three strokes crossing,
                 * then your console isn't fully prepared for UTF-8 encoding.
                 *
                 * Eclipse (Ganymede):
                 *   Window > Preferences : 
                 *   Java > Installed JREs > (current jre) : 
                 *   Edit > Default VM Arguments
             *   (Add -Dfile.encoding="UTF-8" to the options.)
             *
                 * Eclipse (Ganymede):
         *   Window > Preferences :
                 *   General > Appearance > Colors and Fonts :
                 *   Console Font
                 *   (MS Mincho suggested for Japanese.)
                 *
             * The Eclipse Console view shares a common lazy limitation:
             * it assumes that all of the displayed text in a given window
             * must be renderable by glyphs found in a single chosen font.
             * Any missing glyphs are rendered as a box or question mark.
             * 
             * The Unicode standard specifies over 100000 code points.
             * A single TTF font file can only contain 65535 glyphs.
             * Most TTF files will focus on one or two languages.
             * Any window that combines, e.g., a little Arabic and some
             * Chinese would likely run into this kind of display
             * problem.
             * 
             * Good text displays will automatically fall back 
             * on alternative font(s) when a requested Unicode point 
             * is not available in the currently configured font.
                 */
        }
}


Contact Ed Halley by email at ed@halley.cc.
Text, code, layout and artwork are Copyright © 1996-2013 Ed Halley.
Copying in whole or in part, with author attribution, is expressly allowed.
Any references to trademarks are illustrative and are controlled by their respective owners.
Make donations with PayPal - it's fast, free and secure!