Gossamer Forum
Home : General : Perl Programming :

Displaying ligatures

Quote Reply
Displaying ligatures
The content of certain fields (imported into by SQL db) contain words with ligatures, ie. coeur (heart in french!) the o and e being interlaced. This character does not display properly so I attempted a global to clean things up. The oe ligature is - I think - hex CF so I wrote:

<%convert_ligatures%>

sub {
my $tags = shift;
foreach my $tag (%$tags) {
$tags->{$tag} =~ s/c\xCFur/coeur/g;
}
}

but this still displays a weird broken vertical bar. Any ideas? The best of course would be to display the ligatures !
Thanks
Quote Reply
Re: [charly] Displaying ligatures In reply to
This is the site I always use for stuff like that:

http://www.bbsinc.com/iso8859.html

But it only mentions an ae ligature, not oe
Quote Reply
Re: [charly] Displaying ligatures In reply to
\xCF seems to be a different character. You can try it from the command line...

perl -e "print \"\xCF\";"
Quote Reply
Re: [Paul] Displaying ligatures In reply to
Thanks for putting me on the track with the link to the Asci codes page. I found the solution: my ligatured oe was being transformed (by a faulty export from my local db programme) into a broken vertical bar (hex A6). The small case oe ligature is hex 9C. So I have managed to get my ligature to display properly with my global:

sub {
my $tags = shift;
foreach my $tag (%$tags) {
$tags->{$tag} =~ s/\xA6/\x9C/g;
}

I will be extending it to deal with other troublesome Asci signs. Thansk for the help!