Changeset 8767


Ignore:
Timestamp:
2004-12-09T11:49:32+13:00 (19 years ago)
Author:
jrm21
Message:

add 'use utf8' so hopefully substr() is smart enough to cut between
chars and not just bytes, for multi-byte chars.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/HTMLPlug.pm

    r8716 r8767  
    632632    $tmptext =~ s/\s+$//;
    633633    $tmptext =~ s/\s+/ /gs;
     634    # with perl 5.6 at least, substr might segment at a multi-byte char...
     635    use utf8;
    634636    $tmptext = substr ($tmptext, 0, $size);
    635637    $tmptext =~ s/\s\S*$/…/; # adds an ellipse (...)
Note: See TracChangeset for help on using the changeset viewer.