_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › URLEncoding
Describe URLEncoding here

CREATE FUNCTION dbo.UrlEncode(@url varchar(1024))
RETURNS varchar(3072)
AS
 BEGIN
    DECLARE @count int, @c char(1), @i int, @urlReturn varchar(3072)
    SET @count = Len(@url)
    SET @i = 1
    SET @urlReturn = ''    WHILE (@i <= @count)
     BEGIN
        SET @c = substring(@url, @i, 1)
        IF @c LIKE '[A-Za-z0-9()''*-._! ]'
         BEGIN
            SET @urlReturn = @urlReturn + @c
         END
        ELSE
         BEGIN
            SET @urlReturn = 
                   @urlReturn +
                   '%' +
                   SUBSTRING(sys.fn_varbintohexstr(CAST(@c as varbinary(max))),3,2)
         END
        SET @i = @i +1
     END
    RETURN @urlReturn
 END
GO
蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:53

螳 蟾 螳 豺覓 . (襷 覓伎)