[mapguide-internals] Question about encodeComponent method

Arthur Liu arthur.liu at autodesk.com
Wed Dec 2 03:46:02 EST 2009


Hi all,

There's a method named encodeComponent(str) in viewerfiles/utils.js which was migrated from viewerfiles/ajaxmappane.templ

function encodeComponent(str) {  
  op = /\(/g; 
  cp = /\)/g;   
  return encodeURIComponent(str).replace(op, "%%28").replace(cp, "%%29");  
}

Does anyone know why don't we use "%28" and "%29" to encode the brackets but "%%28" and "%%29"? 
There's a related defect: maps whose name contains brackets failed to display in ajax viewer.


Thanks,
Arthur



More information about the mapguide-internals mailing list