On English Wiktionary, `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](https://en.wiktionary.org/wiki/Category:Headword-line_templates_by_language) through [Module:headword](https://en.wiktionary.org/wiki/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](https://en.wiktionary.org/wiki/Category: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 ꝑ](https://en.wiktionary.org/wiki/Category:Latin_terms_spelled_with_%EA%9D%91) would be [Category:Latin terms spelled with Ꝑ](https://en.wiktionary.org/wiki/Category:Latin_terms_spelled_with_%EA%9D%90) 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 § ͷοῖκυ](https://en.wiktionary.org/wiki/Wiktionary:Grease_pit/2019/July#%CD%B7%CE%BF%E1%BF%96%CE%BA%CF%85).
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 Ꜣ, Ꜥ.
Here is a function that will output wikitext if the problembug 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
I'm guessing that this problem originates in PHP because in the same discussion page category headers have been reported as sometimes displaying the lowercase letters ꜣ, ꜥ instead of the uppercase Ꜣ, Ꜥ.