Ignore:
Timestamp:
2011-06-22T18:31:37+12:00 (13 years ago)
Author:
ak19
Message:

Non-English characters in the user-entered buttonname of all classifiers need to be preserved. BaseClassifier now does this, for which it has to assume that the user-entered buttonname is in UTF-8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/unicode.pm

    r23831 r24193  
    848848
    849849
     850sub convert_utf8_string_to_unicode_string
     851{
     852    my $utf8_string = shift(@_);
     853
     854    my $unicode_string = "";
     855    foreach my $unicode_value (@{&unicode::utf82unicode($utf8_string)}) {
     856    $unicode_string .= chr($unicode_value);
     857    }
     858    return $unicode_string;
     859}
     860
     861sub convert_unicode_string_to_utf8_string
     862{
     863    my $unicode_string = shift(@_);
     864
     865    my @unicode_array;
     866    for (my $i = 0; $i < length($unicode_string); $i++) {
     867    push(@unicode_array, ord(&substr($unicode_string, $i, 1)));
     868    }
     869    return &unicode::unicode2utf8(\@unicode_array);
     870}
     871
     872
    8508731;
Note: See TracChangeset for help on using the changeset viewer.