On Sun, 6 Jun 2004 11:09:32 +0200, Henning Hraban Ramm
-----
#!/usr/bin/perl -w use strict; use warnings;
my ($Source, $Target) = (shift, shift); # gets 2 file names from command line
my %conv = ( # enhance as needed "\xD8xA7" => "A", "\xD8xA8" => "b", "\xD8xAC" => "j", "\xD8xAF" => "d" );
open SOURCE, "<", $Source || die $!; open TARGET, ">", $Target || die $!; # there are ways to read a whole file in one scalar, # e.g. with File::Slurp, but I don't know them by heart... while (my $line = <SOURCE>) { foreach my $key (keys %conv) { $line =~ s/$key/$conv{$key}/g; } # foreach print TARGET $line; } # while close SOURCE; close TARGET;
-----
Thnx; I'll play around with this as well. BTW: is there any way to do this without the hex editor and just enter the full 4-digit character (a la Thomas's original suggestion) e.g., "\x0627" => "A" While the hex editor certainly works it is really slow and tedious work...
BTW: ActiveState has Perl 5.8.4, at least for Windows (I use it at work).
Ok, I found it: http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.3.809... But the web site (at first glance) sure gives one the impression that their latest release is 5.6.1.638 http://www.activestate.com/ http://www.activestate.com/Products/ActivePerl/ Best Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523