This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Wed Dec 22, 2004 4:35 pm
as you know all weird chars will be formated to hex using % as a hex symbol, i am trying to parse data from for example %3A to \x3A and resolve it without saving it into \x3A
Code: Select all
foreach {x} [split [lindex [split $url \x3F] 1] \x26] {
if {[regexp {^(.+?)\x3D(.*)$} $x str name value]} {
set _GET([join [string map {\x2B \x20 \x25 \\x} $name]]) [join [string map {\x2B \x20 \x25 \\x} $value]]
}
}
now i need to join in order to resolve it.. also in some cases it gives a weird result for example when using '=' and right after it a 'd' don't know why '=d'
out puts a weird result (greek beta letter) .. instead of =d
XplaiN but think of me as stupid
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Thu Dec 23, 2004 12:54 pm
"resolve it"? what do you mean? and what are you actually trying to accomplish?
you might wish to check Tcllib's package uri
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Thu Dec 23, 2004 5:41 pm
nvm and its not in uri as far as i can say for those who want it ..
Code: Select all
proc mapHex {pre} {
set i 0
while {$i < 1} {
if {[regexp {(.*)%([0-9a-zA-Z]{2})(.*)} $pre str pre hex end]} {
if {[info exists r]} {
set r [format %c 0x${hex}]$end$r
} else {
set r [format %c 0x${hex}]$end
}
} else {
if {[info exists r]} {
return "${pre}${r}"
} else {
return $pre
}
}
}
}
XplaiN but think of me as stupid