Module:DecodeEncode
لاسوند لپاره ددې موډيول کېدای سی په Module:DecodeEncode/لاسوند کي وي
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: لومړی مخدويمه نړېواله جګړهځانگړی:پلټنهويکيپېډيا:د پوهنغونډ په اړهمایک پمپیود اختر لمونځلوی اخترويکيپېډيا:General disclaimerافغانستانويکيپېډياويکيپېډيا:تازه پېښېلارښود:منځپانګهکارن:Af420دوتنه:View to Afghanistan from Tajikistan (30075495368).jpgويکيپېډيا:په اړه۲پښتودوتنه:The Coca-Cola Company logo.svgد ښځې تناسلي آلهويکيپېډيا:له موږ سره اړيکهسردار محمد يوسف خانمېډياويکياوږدمهاله اورګاسمدقربانی احکام او مسائلپلوتونيمکویډ–19اپارتايدوېشنيزه:ویکیپیډیاځانگړی:اوسني بدلونونهويکيپېډيا:جرګهکوچنی اخترويکيپېډيا:د ټولنې تانبهوېشنيزه:1956 زېږېدنېتانبه:مېنځپانگه/تانبېالهام (حدس)ویکیپیډیا:د کارن-نوم بدلولمولانا بجلی ګهرمشاهدهعلي محمد مخلص