And now I test it with:sub beautify { my ($in) = @_; my $tmp; foreach (split(/\s/o, lc($in))){ $tmp .= ucfirst($_); $tmp .= ' '; } $tmp =~ s/\s$//; return($tmp); }
They are all failing. I've tried with:use util; use Test::More tests => 34; is( &util::beautify( "àisTheWord"), "Àistheword", "àisTheWord - specia +l character changes case." ); ... is( &util::beautify( "ùisTheWord"), "Ùistheword", "ùisTheWord - specia +l character changes case." ); is( &util::beautify( "ûisTheWord"), "Ûistheword", "ûisTheWord - specia +l character changes case." ); is( &util::beautify( "üisTheWord"), "Üistheword", "üisTheWord - specia +l character changes case." ); is( &util::beautify( "ÿisTheWord"), "Ÿisthejword", "ÿisTheWord - speci +al character changes case." ); ...
and all subsets of that pair, but to no avail. The system is perl v5.8.8, and when I run the tests on my v5.10 home laptop without any modifications to the original util.pm file, all tests pass! Any insights on how to debug would be very very helpful.use utf8; use Encode;
In reply to UTF8 - ucfirst() is not working with foreign characters by tyatpi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |