Skip to content

Commit

Permalink
gaia: decode special characters used in local file names
Browse files Browse the repository at this point in the history
Mark reports Aladin uses the %xx form for characters like +, those do not match to local files
  • Loading branch information
pwdraper committed Jul 17, 2014
1 parent 53c2b7c commit e9c8712
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions applications/gaia/gaia/library/GaiaSampAgent.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@

#-

# So we can decode encoded characters in the URL.
package require ncgi

itcl::class gaia::GaiaSampAgent {

destructor {
Expand Down Expand Up @@ -255,14 +258,14 @@ itcl::class gaia::GaiaSampAgent {
# protocol (in either its correct RFC1738 "file://host/..." or its
# incorrect but common "file:..." form) then the corresponding
# local filename is returned. Otherwise an empty string is returned.
# Remember to decode any encoded characters (+, space etc.).
private proc get_file_ {url} {
if {[regsub ^file://(localhost|[info host]|)/ $url "" fname]} {
return /$fname
return [::ncgi::decode "/${fname}"]
} elseif {[regsub ^file: $url "" fname]} {
return $fname
} else {
return ""
return [::ncgi::decode $fname]
}
return {}
}

# Provides a suitable value for the "symbol_id" column in a TST table.
Expand Down

0 comments on commit e9c8712

Please sign in to comment.