From 96ad9aece61cec7e6cc20a29b383607cc6cab22a Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 21 Jan 2026 00:51:55 +0800 Subject: mark string.encode/decode as deprecated --- xmake/core/base/string.lua | 6 ++++-- 1 file 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 -- cgit v1.3.1