diff options
| author | ruki <[email protected]> | 2026-01-21 00:51:55 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-01-21 00:51:55 +0800 |
| commit | 96ad9aece61cec7e6cc20a29b383607cc6cab22a (patch) | |
| tree | 53cc5faea2364c67a306ce7e99c21e73d1b031ab /xmake/core/base/string.lua | |
| parent | ae8b2c49195e4f9e28f8ab06f8169e1bca68d1fc (diff) | |
mark string.encode/decode as deprecated
Diffstat (limited to 'xmake/core/base/string.lua')
| -rw-r--r-- | xmake/core/base/string.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xmake/core/base/string.lua b/xmake/core/base/string.lua index c819a5e08..baa4a5e1a 100644 --- a/xmake/core/base/string.lua +++ b/xmake/core/base/string.lua @@ -131,13 +131,15 @@ function string:rtrim(trimchars) return string._trim(self, trimchars, 1) end --- encode: ' ', '=', '\"', '<' +-- encode: ' ', '=', '\"', '<' (deprecated) function string:encode() + deprecated.add(nil, "string:encode()") return (self:gsub("[%s=\"<]", function (w) return string.format("%%%x", w:byte()) end)) end --- decode: ' ', '=', '\"' +-- decode: ' ', '=', '\"' (deprecated) function string:decode() + deprecated.add(nil, "string:decode()") return (self:gsub("%%(%x%x)", function (w) return string.char(tonumber(w, 16)) end)) end |
