Is there a way to uppercase accented characters in perl,
my $string = "éléphant";
print uc($string);
So that it actually prints ÉLÉPHANT ?
My perl script is encoded in ISO-8859-1 and $string is printed in an xml file with the same encoding.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
perlonly understands US-ASCII and UTF-8, and the latter requiresIf you want to keep the file as
iso-8859-1, you’ll need to decode the text explicitly.But it’s probably better to convert the script to UTF-8.
If you’re printing to a file, make sure you use
:encoding(iso-8859-1)when you open the file (no matter which alternative you use).