Ignore:
Timestamp:
2011-05-12T17:37:36+12:00 (13 years ago)
Author:
ak19
Message:

Fixed the unicode-issue that Diego discovered. When using the List classifier, the bookshelf titles were displayed without any special/accented characters, whereas, when the same titles appeared in documents under such bookshelves, the document titles were correctly displayed. Turns out the problem was from utf8-to-unicode and unicode-to-utf8 calls that were not removed after the changes to GS perlcode for making string unicode aware in Perl. So such conversions are already handled elsewhere in the code and no longer belong in List, which fixed the problem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/classify/List.pm

    r24012 r24016  
    383383            # uppercase the metadata - makes the AZList nicer
    384384            $metadata_value = uc($metadata_value);
    385             # Convert the metadata value from a UTF-8 string to a Unicode string
    386             # This means that length() and substr() work properly
    387             # We need to be careful to convert classifier node title values back to UTF-8, however
    388             my $metadata_value_unicode_string = $self->convert_utf8_string_to_unicode_string($metadata_value);
     385           
     386            # We are already working with unicode aware strings at this
     387            # stage, so we no longer need to convert from utf8 to unicode
     388            my $metadata_value_unicode_string = $metadata_value; # $self->convert_utf8_string_to_unicode_string($metadata_value);
    389389
    390390            # Add the metadata value into the list for this combination of metadata group and section
     
    762762
    763763    # Create an hlist partition
    764     my %child_classifier_node = ( 'Title' => $self->convert_unicode_string_to_utf8_string($partitionname),
     764    # Note that we don't need to convert from unicode-aware strings
     765    # to utf8 here, as that is handled elsewhere in the code
     766    my %child_classifier_node = ( 'Title' => $partitionname, #'Title' => $self->convert_unicode_string_to_utf8_string($partitionname),
    765767                  'childtype' => "VList",
    766768                  'contains' => [] );
     
    803805    # Otherwise create a sublist (bookshelf) for the metadata value
    804806    else {
    805         my %child_classifier_node = ( 'Title' => $self->convert_unicode_string_to_utf8_string($metadata_value),
     807        # Note that we don't need to convert from unicode-aware strings
     808        # to utf8 here, as that is handled elsewhere in the code
     809        my %child_classifier_node = ( 'Title' => $metadata_value, # 'Title' => $self->convert_unicode_string_to_utf8_string($metadata_value),
    806810                      'childtype' => "VList",
    807811                      'mdtype' => $metadata_group,
Note: See TracChangeset for help on using the changeset viewer.