sub sms_encode { my $text = shift or return undef; my $placeholder = 'THIS_WILL_BE_THE_EURO_SYMBOL'; my $new =~ s/â¬/$placeholder/; # Regex A $new = from_utf8({-string => $text, -charset => 'ISO-8859-1'}); $new =~ s/$placeholder/€/; # Regex B return $new; }