Modül:DecodeEncode
Modül belgelemesi
require('strict')local p = {}local function _getBoolean( boolean_str )-- from: module:String; adapted-- requires an explicit truelocal boolean_valueif type( boolean_str ) == 'string' thenboolean_str = boolean_str:lower()if boolean_str == 'true' or boolean_str == 'yes' or boolean_str == '1' thenboolean_value = trueelseboolean_value = falseendelseif type( boolean_str ) == 'boolean' thenboolean_value = boolean_strelseboolean_value = falseendreturn boolean_valueendfunction p.decode( frame )local s = frame.args['s'] or ''local subset_only = _getBoolean(frame.args['subset_only'] or false)return p._decode( s, subset_only )endfunction p._decode( s, subset_only )-- U+2009 THIN SPACE: workaround for bug: HTML entity   is decoded incorrect. Entity   gets decoded properlys = mw.ustring.gsub( s, ' ', ' ' )-- U+03B5 ε GREEK SMALL LETTER EPSILON: workaround for bug (phab:T328840): HTML entity ε is decoded incorrect for gsub(). Entity ε gets decoded properlys = mw.ustring.gsub( s, 'ε', 'ε' )local ret = mw.text.decode( s, not subset_only )return retendfunction p.encode( frame )local s = frame.args['s'] or ''local charset = frame.args['charset']return p._encode( s, charset )endfunction p._encode( s, charset )-- example: charset = '_&©−°\\\"\'\=' -- do escape with backslash not %;local retif charset and charset ~= '' thenret = mw.text.encode( s, charset )else-- use default: chartset = '<>&"\' ' (outer quotes = lua required; space = NBSP)ret = mw.text.encode( s )end return retendreturn p
🔥 Top keywords: Anasayfa2024 Avrupa Futbol ŞampiyonasıÖzel:AraAvrupa Futbol ŞampiyonasıAişe2020 Avrupa Futbol ŞampiyonasıOktay Kaynarca2024 FIVB Kadınlar Voleybol Milletler LigiKylian MbappéSlovakyaTürkiye2024 Avrupa Futbol Şampiyonası elemeleriFIVB Dünya SıralamasıFIFA Dünya KupasıTürkiye millî futbol takımıMuhammed'in evlilikleriGibi bölümleri listesi2008 Avrupa Futbol ŞampiyonasıKurban BayramıVII. KleopatraGülse BirselRomelu LukakuOsmanlı padişahları listesiÖzel:SonDeğişikliklerMuhammedÜlkeler listesiAntoine Griezmann2026 FIFA Dünya KupasıVatan ŞaşmazII. MehmedOsmanlı İmparatorluğuFIFA Dünya Kupası finalleri listesiBurçlarSeks pozisyonlarıUsame bin LadinGheorghe HagiPrens (dizi)Muğla'nın ilçeleriSıla