Convert web characters hex to char or vice versa

This tip describes how to convert web characters hex to char or vice versa.

Web url's that contain hex code convert to char in LotusScript with this function: Can also be used other way around, for making save url's


Function LSreplacehex(runString As String) As String '// build array's hex and char Dim hexArray(33) As String hexArray(0) = "%20" hexArray(1) = "%21" hexArray(2) = "%22" hexArray(3) = "%23" hexArray(4) = "%24" hexArray(5) = "%25" hexArray(6) = "%26" hexArray(7) = "%27" hexArray(8) = "%28" hexArray(9) = "%29" hexArray(10) = "%2A" hexArray(11) = "%2B" hexArray(12) = "%2C" hexArray(13) = "%2D" hexArray(14) = "%2E" hexArray(15) = "%2F" hexArray(16) = "%3A" hexArray(17) = "%3B" hexArray(18) = "%3C" hexArray(19) = "%3D" hexArray(20) = "%3E" hexArray(21) = "%3F" hexArray(22) = "%40" hexArray(23) = "%5B" hexArray(24) = "%5C" hexArray(25) = "%5D" hexArray(26) = "%5E" hexArray(27) = "%5F" hexArray(28) = "%60" hexArray(29) = "%7B" hexArray(30) = "%7C" hexArray(31) = "%7D" hexArray(32) = "%7E" Dim charArray(33) As String charArray(0) = " " charArray(1) = "!" charArray(2) = """" charArray(3) = "#" charArray(4) = "$" charArray(5) = "%" charArray(6) = "&" charArray(7) = "'" charArray(8) = "(" charArray(9) = ")" charArray(10) = "*" charArray(11) = "+" charArray(12) = "," charArray(13) = "-" charArray(14) = "." charArray(15) = "/" charArray(16) = ":" charArray(17) = ";" charArray(18) = "<" charArray(19) = "=" charArray(20) = ">" charArray(21) = "?" charArray(22) = "@" charArray(23) = "[" charArray(24) = "" charArray(25) = "]" charArray(26) = "^" charArray(27) = "_" charArray(28) = "`" charArray(29) = "{" charArray(30) = "|" charArray(31) = "}" charArray(32) = "~" teller = 0 While teller < 33 runString = LSReplaceSubstring( runString , hexArray(teller) , charArray(teller)) teller = teller + 1 Wend LSreplacehex = runString End Function
This was first published in November 2002
This Content Component encountered an error

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close