Changeset 6849


Ignore:
Timestamp:
2004-02-19T14:16:19+13:00 (20 years ago)
Author:
mdewsnip
Message:

Fix to the weird "half-good, half-bad" Unicode display on Windows. Turns out Java was kindly marking some characters as "undisplayable", and replacing them with question marks -- great, thanks very much.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/Dictionary.java

    r6821 r6849  
    226226        complete = complete + initial;
    227227
    228         String unicode = null;
     228        String unicode = "";
    229229        try {
    230         unicode = new String(complete.getBytes(), "UTF-8");
     230        // This "ISO-8859-1" looks out of place, but it is very important.
     231        // It is essential to call getBytes with an 8-bit encoding, otherwise
     232        // Java kindly deems some characters "undisplayable", and replaces
     233        // them with question marks. This is NOT good.
     234        unicode = new String(complete.getBytes("ISO-8859-1"), "UTF-8");
    231235        }
    232236        catch (Exception ex) {
Note: See TracChangeset for help on using the changeset viewer.