Libre Posted March 9, 2006 Share 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 !!!!!? Link to comment Share on other sites More sharing options...
Valuater Posted March 9, 2006 Share 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 Link to comment Share on other sites More sharing options...
ConsultingJoe Posted March 9, 2006 Share 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 [center]AutoIT + Finger Print Reader/Scanner = COOL STUFF -> Check Out Topic![/center][center][font=Arial Black]Check out ConsultingJoe.com[/font][/center][center]My Scripts~~~~~~~~~~~~~~Web Protocol Managing - Simple WiFi Scanner - AutoTunes - Remote PC Control V2 - Audio SpectrascopePie Chart UDF - At&t's TTS - Custom Progress Bar - Windows Media Player Embed[/center] Link to comment Share on other sites More sharing options...
FuryCell Posted March 10, 2006 Share 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. Link to comment Share on other sites More sharing options...
MFerris Posted April 9, 2006 Share 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 Link to comment Share on other sites More sharing options...
nfwu Posted April 12, 2006 Share 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() Link to comment Share on other sites More sharing options...
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