Silly me! I should have anticipated the need to go back again! Can anyone
give me a little script to search for XML entities and convert them to my
choice of utf-8, utf-16 or utf-32?
Thanks!
Siegfried

>> Does anyone have some perl (or emacs lisp) code that will convert the
UTF-8 chinese text in my XML file to entities that look like this: 安?
>> 
>> Thanks!
>> siegfried
>
>
>#!/usr/bin/perl
>
>use strict;
>use warnings;
>
>for my $file ( @ARGV ){
>  open my $fh, '<:utf8', $file or die "cannot open file $file: $!";
>  while( <$fh> ){
>    s/([\x7f-\x{ffffff}])/'&#'.ord($1).';'/ge;
>    print;
>  }
>}
>
>__END__
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to