#!/usr/bin/env perl use warnings; use strict; binmode STDOUT, 'encoding(UTF-8)'; my $s = ; chomp $s; my @j = split /(\\x\{[a-f0-9]+\})/i, $s; my $ils = ''; for my $c ( @j ) { $c = chr hex $1 if $c =~ /\\x\{([a-f0-9]+)\}/i; $ils .= $c; } print $ils;