#!/usr/bin/perl

use strict;
use Encode qw(from_to);

while(<>)
{
	my $inText = $_;
	&from_to( $inText, 'utf-8', 'UCS-2BE' );
	$inText =~ s/(..)/ myconvert($1) /gie;
	&from_to( $inText, 'UCS-2BE' , 'utf-8');
	print $inText;
}

sub myconvert
{
	my $ucs2 = shift; 
	my $code = unpack('n', $ucs2);
	if($code>127){
		my $t = '\u'. sprintf("%lx",$code);
		&from_to( $t, 'utf-8' ,'UCS-2BE');
		return $t;
	}
	else
	{
		return $ucs2;
	}
}