မဝ်ဂျူ:string/encode entities
မံက်ပြာကတ်
- မဝ်ဂျူ တဏအ်ဝွံဟွံမွဲကဵုလိက်စၟတ်သမ္တီမချူလဝ်နကဵုမုက်လိက်ဓမၠေံ။ သ္ပဂုန်တုဲ ဍဵုခၞံဗဒှ်ဏံညိ။
- Redirected from မဝ်ဂျူ:string/encode entities/documentation (ပလေဝ်ဒါန်)။
- လေန်မရပ်စပ်သုၚ်စောဲ: မုက်လိက်တံရိုဟ် • တံရိုဟ်မုက်လိက်ဓမၠေံဂမၠိုၚ် • လေန်ဂမၠိုၚ် • ပရေၚ်မပံၚ်စပ်ဂမၠိုၚ် • testcases • ကဠာသံၚ်ဗ္တဳ
-- TO BE REPLACED BY encode_entities in [[Module:string utilities]]. This function decodes on input by default to prevent double-encoding, which the new function does not, so implementations need to take this into account when being converted.
local debug_track_module = "Module:debug/track"
local string_decode_entities_module = "Module:string/decodeEntities"
local string_utilities_module = "Module:string utilities"
local require = require
local function decode_entities(...)
decode_entities = require(string_decode_entities_module)
return decode_entities(...)
end
local function encode_entities(...)
encode_entities = require(string_utilities_module).encode_entities
return encode_entities(...)
end
local function track(...)
track = require(debug_track_module)
return track(...)
end
return function(str, charset, raw)
if not raw then
local decoded = decode_entities(str)
if decoded ~= str then
track("string/encode entities/decoded first")
end
str = decoded
end
return encode_entities(str, charset, nil, true)
end