I just read your posting from 9 Aug 2004 14:18:16 -0000. Presumably you have solved 
your problem in the meantime. I haven't received any more recent digest from this 
list. Have you received some replies ?

As you know, character conversion from PC to Mac isn't straightforward, because the 
charsets (glyphs) do not match entirely. I have used a conversion table proposed by 
<[EMAIL PROTECTED]>. Infos were available at: 
ftp://ftp.sri.ucl.ac.be/pub/ISO.8859-1/MacISO.taBL.sea.hqx. I haven't checked the URL 
recently.

An example of a conversion routine follows. It handles only the ISO8859-1 charset (96 
chars), a subset of CP1252. Extending it to 128 chars is obvious.

Bonne chance
- - -
#!/usr/local/bin/perl -w
use strict;
$_ = "j'ai mangÈ des mšres ý AlenÁon"; # ISO code
print iso2mac($_),"\n"; # Mac code

sub iso2mac

# conversion iso8859-1 en Mac
# arg1: string à convertir

{my ($isoset,$macset);
$isoset = join '', map{chr}(0xA0..0xFF);
$macset = 
' ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ';
        eval "\$_[0] =~ tr/$isoset/$macset/";
        return $_[0];
}1;
__END__

Reply via email to