Output:#!/usr/bin/env perl use strict; use warnings; show( 'Resume' ); show( 'Résumé' ); sub show { my $s = shift @_; print "The string is: '$s'\n\t"; for ( split //, $s ){ printf "%02X ", ord( $_ ); } print "\n\n"; my $t = uc( $s ); print "\tUppercase: '$t'\n"; $t = lc( $t ); print "\tLowercase: '$t'\n"; printf "\tlength = %d\n", length( $s ); { use bytes; printf "\tbytes = %d\n", length( $s ); } print "\n"; } __END__
I needed to know the number of characters, the number of bytes, and how to convert to uppercase and lowercase. Version:The string is: 'Resume' 52 65 73 75 6D 65 Uppercase: 'RESUME' Lowercase: 'resume' length = 6 bytes = 6 The string is: 'Résumé' 52 C3 A9 73 75 6D C3 A9 Uppercase: 'RéSUMé' Lowercase: 'résumé' length = 8 bytes = 8
$ perl -v This is perl, v5.10.0 built for ppc-linux Copyright 1987-2007, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge.
In reply to Help with Accented Characters by shawnhcorey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |