perlfellas has asked for the wisdom of the Perl Monks concerning the following question:

Hi, Is there any way to convert lowercase unicode character(i.e é) to uppercase(É) in perl?

Replies are listed 'Best First'.
Re: Unicode Case Conversion
by Zaxo (Archbishop) on Mar 24, 2005 at 12:41 UTC

    If perl 5.8 has identified the string as unicode, uc will do the job.

    After Compline,
    Zaxo

Re: Unicode Case Conversion
by tlm (Prior) on Mar 24, 2005 at 12:35 UTC

    It looks like

    % perldoc -f uc % perldoc perlunicode % perldoc perllocale
    may be a good place to start.

    the lowliest monk

Re: Unicode Case Conversion
by jbrugger (Parson) on Mar 24, 2005 at 12:39 UTC
    try to use a regexp, lc and uc won't work .
    perl -le '$bla = "é_to_upper"; $bla =~ s/é/É/g; print $bla ;'

    Update:Zaxo is right:
    perl -le 'my $e ="é"; utf8::upgrade($e); print uc $e;' #prints É
    "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.
Re: Unicode Case Conversion
by tbone1 (Monsignor) on Mar 24, 2005 at 13:16 UTC
      Hi, Is there any way to convert lowercase unicode character(i.e é) to uppercase(É) in perl?

    Is it just me, or was anyone else tempted to answer this with just a "Yes, there is"? I really need to get more coffee...

    --
    tbone1, YAPS (Yet Another Perl Schlub)
    And remember, if he succeeds, so what.
    - Chick McGee