Libre Posted March 9, 2006 Posted March 9, 2006 (edited) This script covert a simple string to a valid url for a web server. ;##################################################################### ; URLEncode(x) convierte la direccion web a lo que el servidor quiere ;##################################################################### Func URLEncode( $urlText ) $url ="" For $i = 1 To StringLen($urlText) $acode = Asc(StringMid( $urlText, $i, 1 ) ) Select Case ( $acode>=48 and $acode <= 57 )or _ ( $acode>=65 and $acode <= 90 )or _ ( $acode>=97 and $acode <= 122 ) $url = $url & StringMid($urlText, $i, 1) Case $acode=32 $url = $url & "+" Case Else $url = $url & "%" & Hex($acode,2) EndSelect Next return $url EndFunc Edited March 9, 2006 by Libre I love this Game :p----------------------Freeware Multilange support or Translate your scripts----------------------aNyBoDy KnOwS WhY A LiGhT iN My KeYbOaRd iS aLlWaIs BlInKiNg !?Who is "General Failure" and what is he doing in my hard disk !!!!!?
Valuater Posted March 9, 2006 Posted March 9, 2006 (edited) the first code box should be [ code ] no spaces then [ /code ] ; no spaces same with "quote" 8) Edited March 9, 2006 by Valuater
ConsultingJoe Posted March 9, 2006 Posted March 9, 2006 nice script i used this for quick converting but nice UDF, I could really use this. $i = URLEncode(InputBox("convert","enter text")) MsgBox(0,"",$i) Func URLEncode( $urlText ) $url ="" For $i = 1 To StringLen($urlText) $acode = Asc(StringMid( $urlText, $i, 1 ) ) Select Case ( $acode>=48 and $acode <= 57 )or _ ( $acode>=65 and $acode <= 90 )or _ ( $acode>=97 and $acode <= 122 ) $url = $url & StringMid($urlText, $i, 1) Case $acode=32 $url = $url & "+" Case Else $url = $url & "%" & Hex($acode,2) EndSelect Next return $url EndFunc Check out ConsultingJoe.com
FuryCell Posted March 10, 2006 Posted March 10, 2006 (edited) I might be wrong but i think this can already be done with _INetExplorerCapable() which is included in inet.au3.anyway. good job and welcome to the forums.Edit: nvm. this one converts all characters. cool. Edited March 30, 2006 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
MFerris Posted April 9, 2006 Posted April 9, 2006 (edited) This script covert a simple string to a valid url for a web server.Just wanted to say thanks - this is exactly what I need for a project I'm working on, you saved me a lot of trouble! Edited April 9, 2006 by MFerris
nfwu Posted April 12, 2006 Posted April 12, 2006 You could upgrate this to support RFC 1738.Look at: http://www.autoitscript.com/forum/index.php?showtopic=23315for an example.{http://www.ietf.org/rfc/rfc1738.txt}#) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode()
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now