Ignore:
Timestamp:
2010-12-09T22:27:33+13:00 (13 years ago)
Author:
ak19
Message:

GLI now has a gs.FilenameEncoding metadata field which appears like all the others in GLI's EnrichPane, but is unique in that this metadata (once set, changed or removed) must be applied to the affected filenames in the Collection Tree. More importantly, the changes made for this are to allow GLI's java code to interact with the recent changes to Perl where strings were made unicode-aware (for proper regex matching) but which required other changes elsewhere. To still support filenames with different encodings Perl used URL encoded versions of filenames representing characters' code point values in URL encoding. This required that GLI write out URL encoded filenames to the metadata.xml files that are associated with each folder level of a collection, so that Perl can read them. In this way, they can both speak of the same filenames. Only works on unicode 16 (such as latin-1), non-UTF8 systems. The latter is a requirement since Java uses the filesystem encoding from startup. If it is UTF8, non-recognised characters are replaced by the invalid char for UTF8. This process being destructive, we can't get the original filenames' bytecodes back. The changes made to GLI will work on Windows which is UTF-16 (windows codepage 1252), presumably also Macs (some kind of UTF-16) and also works on Native Latin 1 Linux systems. UTF-8 Linux systems need to be reconfigured to Native Latin-1, or if not installed, an administrator can install it easily.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r23143 r23433  
    5959import org.greenstone.gatherer.gui.metaaudit.MetaAuditFrame;
    6060import org.greenstone.gatherer.gui.tree.DragTree;
     61import org.greenstone.gatherer.metadata.FilenameEncoding;
    6162import org.greenstone.gatherer.metadata.MetadataSet;
    6263import org.greenstone.gatherer.metadata.MetadataXMLFileManager;
     
    295296    tab_pane.setSelectedComponent(gather_pane);
    296297    Gatherer.c_man.closeCollection();
     298    FilenameEncoding.closeCollection(); // clear filename-to-encodings map
    297299    }
    298300
Note: See TracChangeset for help on using the changeset viewer.