martinszutner Posted September 8, 2008 Posted September 8, 2008 Hi, when I run FixEncode('m ;a ;" onmouseover') ;without space between numbres and semicolon Func FixEncode($vHTML) $resultado =StringRegExpReplace($vHTML, '\&\#([0-9]+)\;',("\1")) ConsoleWrite( $resultado) return ($resultado) EndFuncoÝ÷ Ú·º¹â¶Ø^rëyËh "{¦n·¬×OZÝ=í»Â§!Øb+hjëh×6FixEncode('m ;a ;" onmouseover') Func FixEncode($vHTML) $resultado =StringRegExpReplace($vHTML, '\&\#([0-9]+)\;',chr("\1")) ConsoleWrite( $resultado) return ($resultado) EndFunc It don`t return nothing (should be "ma") whait is the razon???????
dbzfanatic Posted September 8, 2008 Posted September 8, 2008 Why do you keep posting over and over? Post once or you will ignored. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
martinszutner Posted September 8, 2008 Author Posted September 8, 2008 Why do you keep posting over and over? Post once or you will ignored. I found this solution Func FixEncode($vString ) While 1 $regexp = StringRegExp($vString, '\&\#([0-9]+)\;', 1) If UBound($regexp) >= 1 Then $regexp = Chr($regexp[0]) $vString = StringRegExpReplace($vString, '\&\#([0-9]+)\;', $regexp, 1) Else ExitLoop EndIf WEnd return ($vstring) EndFunc and other note, this forum can accept UNICode Chars. For this razon I did post twice it
dbzfanatic Posted September 8, 2008 Posted September 8, 2008 You posted 3 times. Learn to count and learn about the "edit" buttons. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
Bowmore Posted September 8, 2008 Posted September 8, 2008 Hi, when I run FixEncode('m ;a ;" onmouseover') ;without space between numbres and semicolon Func FixEncode($vHTML) $resultado =StringRegExpReplace($vHTML, '\&\#([0-9]+)\;',chr("\1")) ConsoleWrite( $resultado) return ($resultado) EndFunc It don`t return nothing (should be "ma") whait is the razon???????Read this post for an explanation. Why chr("\1") will not work in StringRegExReplace() "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook
martinszutner Posted September 8, 2008 Author Posted September 8, 2008 Read this post for an explanation. Why chr("\1") will not work in StringRegExReplace()I saw that, I tried to replace the \1 for $1, but that does not work
PsaltyDS Posted September 8, 2008 Posted September 8, 2008 (edited) I saw that, I tried to replace the \1 for $1, but that does not work The difference between "\1" and $1 was not the point. The Chr() function is run before the StringRegExpReplace() gets done at all. Since your input to Chr() is a string vice an integer, it is equivalent to Chr(0) which is a null character. The substitution does actually happen, but a null character is inserted, with terminates the string at the first character when you try to display it: FixEncode('ma" onmouseover');without space between numbres and semicolon Func FixEncode($vHTML) $resultado = StringRegExpReplace($vHTML, '\&\#([0-9]+)\;', Chr("\1")) ConsoleWrite("@error = " & @error & " @extended = " & @extended & @LF) ConsoleWrite("Lenth = " & BinaryLen($resultado) & @LF) ConsoleWrite("Binary = " & StringToBinary($resultado) & @LF) ConsoleWrite("$resultado = " & $resultado & @LF) Return ($resultado) EndFunc ;==>FixEncode I think your multiple posting was caused by trying to work around the awkward formatting on the forum, so I'm sympathetic. Try using the code tags and avoid the autoit tags, they are buggy. Edited September 8, 2008 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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