On English Wiktionary, the Scribunto functions mw.ustring.upper and mw.ustring.lower are sometimes failing to transform certain code points that have an uppercase mapping. As a consequence, some of the categories for terms spelled with unusual characters, which are added by headword-line templates through Module:headword, which should show characters in uppercase when the uppercase version is not one of the standardChars for the language (see the language data modules for examples), have been alternating between uppercase and lowercase. I've just observed this for ꝑ; the category Category:Latin terms spelled with ꝑ would be Category:Latin terms spelled with Ꝑ if mw.ustring.upper("ꝑ") returned "Ꝑ" as it should. This has also been reported as happening to the character ͷ in a discussion page at Wiktionary:Grease pit/2019/July § ͷοῖκυ.
I'm guessing that this originates in PHP because in the same discussion page category headers have been reported as sometimes displaying the lowercase letters ꜣ, ꜥ instead of the uppercase Ꜣ, Ꜥ. That bug can be seen right now by paging to Ꜣ in Category:Egyptian lemmas, where there are headers for uppercase Ꜣ, lowercase ꜣ, uppercase Ꜥ, and lowercase ꜥ.
Here is a function that will output wikitext if the bug is present:
function test()
local output = {}
local function show_casing(letter, func)
table.insert(output, '* mw.ustring.' .. func .. '("' .. letter .. '") → "' .. mw.ustring[func](letter) .. '"')
end
local function assert_casing(lower, upper)
if mw.ustring.upper(lower) ~= upper then
show_casing(lower, "upper")
end
if mw.ustring.lower(upper) ~= lower then
show_casing(upper, "lower")
end
end
assert_casing("a", "A")
assert_casing("ç", "Ç")
assert_casing("ꝑ", "Ꝑ")
assert_casing("ͷ", "Ͷ")
assert_casing("ꜣ", "Ꜣ")
assert_casing("ꜥ", "Ꜥ")
return table.concat(output, "\n")
end