Can use a pure-Lua UTF-8 decoder, like the one in require('luabit/utf8.lua')

→ mw.ustring allows to treat UTF-8 strings

os.date() with support for at least "!*t" and "*t" formats; and os.time()

280 thousand pages on the English Wikipedia use its w:en:Template:Birth date and age template, and they all expect to be able to obtain the current date in a broken down form so that they can do calendar arithmetic.

A Lua program should be able to obtain everything that non-Scribunto templates can obtain through {{CURRENTYEAR}}, {{CURRENTMONTH}}, {{CURRENTMONTHNAME}}, {{CURRENTMONTHNAMEGEN}}, {{CURRENTMONTHABBREV}}, {{CURRENTDAY}}, {{CURRENTDAY2}}, {{CURRENTDOW}}, {{CURRENTDAYNAME}}, {{CURRENTTIME}}, {{CURRENTHOUR}}, and {{CURRENTWEEK}}[1].

→ "*t" and "!*t" works. Moreover mw.language allows to get localized object to have local time (and not server local time)

Lots of English Wikipedia maintenance templates effectively do the {{#switch:{{NAMESPACENUMBER}}}} trick.

Non maintenance templates use this to prevent including article categories in other namespaces (i.e. docs or talk pages).

→ mw.title included. Same than page title.

mw.text.escape(), mw.url.encode(), mw.url.encodeAnchor()

Of course, these can be done in Lua. But these encoders are used frequently. The English Wikipedia's citation templates need to URL encode COinS data, for example. A C implementation would be faster than a Lua one.

→ mw.uri library does this stuff.

mw.text.tag()

Same as the encoders above. This is used a lot.

→ same

mw.url.local() and mw.url.full()

Navigation boxes on the English Wikipedia need these for their "v·d·e" links.

→ mw.title.new() allows to create titles for any page, and to test if it exists or not.

the string library is broken on strings that come from template parameters if they include some tags (i.e. <nowiki> and <pre>). string functions act as if they can only see the special encoding of the first tag (example: passing "<pre>my string</pre>" to a template is see by the module as a 39 bytes length string (whatever the string content), which is the length of the encoded "<pre>" tag. This also prevent string functions to search or modify the "real" string content. See bug report

↑ 1.01.11.2Of course this can be simulated using frame:preprocess("{{THE-PSEUDO-TEMPLATE}}"). But 1. this is maybe not the most efficient way to perform this and 2. a metatable to perform/store this − like for the args table − should be cleaner and would allow future improvements without impacting users code.