New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4 pod casemapping errors: s/(\w+)/\u\L$1/g is always wrong #11568
Comments
From tchrist@perl.comThese are all in error: perldata.pod: s/(\w+)/\u\L$1/g; # "titlecase" words They don't work because you cannot guarantee a correct titlecase Here are two places where you get an error doing it the way orig => İ is 0130 orig => ẞ is 1E9E The correct approach requires something more like s/\b(\w)(\w*)\b/\u$1\L$2/g; # "titlecase" "words" Because casemapA(string) is never guaranteed to be the --tom #!/usr/bin/env perl use utf8; use v5.14; my @chars = ( "\N{LATIN SMALL LETTER SHARP S}", sub report($$;$) { for my $char (@chars) { report "orig " => $char; __END__ Summary of my perl5 (revision 5 version 14 subversion 0) configuration: Characteristics of this binary (from libperl): |
From @jkeenanOn Mon Aug 08 16:17:27 2011, tom christiansen wrote:
The first error could simply be deleted, as the feature which it is
Can anyone provide a documentation patch? Thank you very much. |
The RT System itself - Status changed from 'new' to 'open' |
It seems to me the pods should just say, for example
instead of what it now says
Tom's approach is overly complicated. |
\u will uppercase the first character, but it will leave the rest unchanged. if you want titlecase you normally want the rest lowercased which the \L does first |
Ok |
This closes GH Perl#11568
This closes GH Perl#11568
Migrated from rt.perl.org#96592 (status was 'open')
Searchable as RT96592$
The text was updated successfully, but these errors were encountered: