use feature 'unicode_strings'; is an excellent point!

Since neither "use feature 'unicode_strings';", nor e.g. "use 5.016;" was declared, then lc does exactly as described above.

If by "described above" you mean "Only the characters A-Z change, to a-z respectively.", then I think your reading of the lc docs might be a little off, my understanding is that bytes is not the default behavior. The following test took a little fiddling to get the right values but it passes on all Perl releases starting with 5.8.1, 5.8.9, 5.10.1, up to 5.26 and shows the differences:

use warnings;
use strict;
use utf8;
use Test::More;

diag explain "Perl $]";
plan tests => $] ge '5.012' ? 15 : 11;
SKIP: {
	is "\N{U+00C9}", "É",           '\N{U+...} escape';
	skip 'Perl ge 5.12 required', 1 unless $] ge '5.012';
	ok utf8::is_utf8("\N{U+00C9}"), '\N{U+...} sets UTF8';
}
{
	ok !utf8::is_utf8("\x{C9}"),    '\x doesn\'t set UTF8';
	is lc("\x{C9}"), "\xC9",        'lc on non-UTF8 str';
	ok utf8::is_utf8("É"),          'str is UTF8';
	is lc("É"), "é",                'lc on UTF8 str';
}
{
	use bytes;
	ok !utf8::is_utf8("\x{C9}"),    'bytes: \x doesn\'t set UTF8';
	is lc("\x{C9}"), "\xC9",        'bytes: lc on non-UTF8 str';
	ok utf8::is_utf8("É"),          'bytes: str is UTF8';
	is lc("É"), $] lt '5.008009' ? "\xC9" : "\xC3\x89",
	                                'bytes: lc on UTF8 str';
}
SKIP: { skip 'Perl ge 5.12 required', 1 unless $] ge '5.012';
ok eval q{ do {
	use feature 'unicode_strings';
	ok !utf8::is_utf8("\x{C9}"),    'u_s: \x doesn\'t set UTF8';
	is lc("\x{C9}"), "é",           'u_s: lc on non-UTF8 str';
	ok utf8::is_utf8("É"),          'u_s: str is UTF8';
	is lc("É"), "é",                'u_s: lc on UTF8 str';
1 } }, 'unicode_strings works' or warn $@ }

In reply to Re^2: Unexpected interaction between decode_entities() and lc() by haukex
in thread Unexpected interaction between decode_entities() and lc() by kurisuto

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.