Ignore:
Timestamp:
2015-03-19T13:53:24+13:00 (9 years ago)
Author:
ak19
Message:

some more changes to make adding metadata to filenames with non latin1 characters work. previously, any char above 127 was being output as %XX. this doesn't work as higher values can end up like %101. but when you decode you only ever look for 2 digits after the %. so higher values we'll use entities like ā then had to modify the xml writing to not escape the text in hte filename element - otherwise get ā

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/metadata/MetadataXMLFile.java

    r23433 r29793  
    4545    static final private String FILESET_ELEMENT = "FileSet";
    4646    static final private String METADATA_ELEMENT = "Metadata";
    47 
     47    static final private String[] nonEscapingElements = new String[]{FILENAME_ELEMENT};
     48   
    4849    /** Special metadata field: the filename encoding is a unique sort of metadata in
    4950     * that it is not just information stored with a collection file, but also needs to
     
    123124    // If no appropriate FileSet element exists create a new one for this file
    124125    if (appropriate_fileset_element == null) {
    125         DebugStream.println("Creating new FileSet element for file since none exists...");
     126        DebugStream.println("Creating new FileSet element for file since none exists..."+file_path_regexp);
    126127        appropriate_fileset_element = loaded_file_document.createElement(FILESET_ELEMENT);
    127128
     
    605606    // If we have a file loaded into memory and it has been modified, save it now
    606607    if (loaded_file != null && loaded_file_changed == true) {
    607         XMLTools.writeXMLFile(loaded_file, loaded_file_document);
     608        XMLTools.writeXMLFile(loaded_file, loaded_file_document, nonEscapingElements);
     609   
     610       
    608611        loaded_file_changed = false;
    609612    }
Note: See TracChangeset for help on using the changeset viewer.