Greetings,
I've tried everything, read everything, and i can't figure out how to
convert by unicode strings to hex?
&u03B8;&u03B5;&u1F79;&u03C0;&u03BD;&u03B5;&u03C5;&u03C3;&u03C4;&u03BF;&u03C2;
back to
&#XXXX;&#XXXX;&#XXXX;&#XXXX;&#XXXX;&#XXXX;etc
while (<INFILE>){
$body = $_;
$body =~ s{<(heb|grc|arc)>(.*?)<\/\1>}
{
my $prefix=$1;
my $return=$2;
for ($return) {
s{\&\u(.*?);}
{
$u = $1;
#DO SOMETHING HERE?
"\&#$u;";
}ge;
}
"<$prefix>$return</$prefix>"
}ge;
this goes from hex to unicode if that helps
$body =~ s{\&\#(\d+);}
{
my $hex = sprintf "%04lX", $1;
"\&u$hex;"
}ge;
I've tried everything, read everything, and i can't figure out how to
convert by unicode strings to hex?
&u03B8;&u03B5;&u1F79;&u03C0;&u03BD;&u03B5;&u03C5;&u03C3;&u03C4;&u03BF;&u03C2;
back to
&#XXXX;&#XXXX;&#XXXX;&#XXXX;&#XXXX;&#XXXX;etc
while (<INFILE>){
$body = $_;
$body =~ s{<(heb|grc|arc)>(.*?)<\/\1>}
{
my $prefix=$1;
my $return=$2;
for ($return) {
s{\&\u(.*?);}
{
$u = $1;
#DO SOMETHING HERE?
"\&#$u;";
}ge;
}
"<$prefix>$return</$prefix>"
}ge;
this goes from hex to unicode if that helps
$body =~ s{\&\#(\d+);}
{
my $hex = sprintf "%04lX", $1;
"\&u$hex;"
}ge;