aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes encoding issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "encoding issue" Watch "encoding issue" New topic

encoding issue

Viidhya Kishore
Ranch Hand

Joined: Jan 03, 2007
Posts: 99
Hello all,
I am passing a user name as a URL queryString.
The user name has a back slash which is getting escaped.
Please help.
Code :

js fn -
var reassignTo = '<%=request.getAttribute("reassignTo") %>'; // user name is 'NIH\ADAMSBR'
function reassignOwnership(){
var url = '<%= sServletBaseHREF %>admin/manageUserItem.reassignOwnership.grs?itemType=' + itemType + '&owned=' + owned +'&<%=ManageUserItemController.ITEM_REASSIGN_TO_OWNER_TOKEN%>=' + reassignTo;
window.opener.document.location = url;

When I alert the URL, 'NIH\ADAMSBR' comes as 'NIHADAMBR'.
Please help (

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
You need to double it up than with a string replace.

CIT eh?

Viidhya Kishore
Ranch Hand

Joined: Jan 03, 2007
Posts: 99
Thanks a lot Eric!

I agree. Here's the link:
subject: encoding issue
Similar Threads
Trouble getting IFRame Call to work
not able to get uploaded file size in javascript
Encoding and Decoding
toggle checkbox group when the max limit is reached
Script using array