Module:Punycode: Difference between revisions

// via Wikitext Extension for VSCode
// via Wikitext Extension for VSCode
 
Line 1: Line 1:
----------------------------------------------------------------
--[[
-- Module:Punycode –  RFC 3492 implementation for Lua 5.1 (Scribunto)
* Name: Punycode
-- * punycode.encode(label)      – Punycode for ONE label (no dots)
* Author: Mark W. Datysgeld
-- * punycode.decode(label)      – back to Unicode
* Description: RFC3492 Punycode implementation for IDN support with caching
-- * punycode.toASCII(domain)    – full domain → IDNA (handles dots, xn--)
* Notes: encode/decode for single labels (no dots); toASCII/toUnicode for full domains (handles dots, xn-- prefixes); UTF-8 compatible with mw.ustring fallback; includes caching for performance
-- * punycode.toUnicode(domain)  – IDNA domain → Unicode
]]
----------------------------------------------------------------
local punycode = {}
local punycode = {}