#!/usr/bin/perl use Encode; # Perl char string (UTF-8) - i.e. your input # (this is the Russian word - literal UTF-8 chars wouldn't be displayed # correctly in PerlMonks blocks - thus here as \x{....} ) my $str = "\x{0442}\x{0435}\x{0441}\x{0442}"; my $utf16 = encode("UTF-16be", $str); my $sms = unpack "H*", $utf16; print "$sms\n"; # "0442043504410442"