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
Author

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(){
window.opener.showProcessingSpan();
var url = '<%= sServletBaseHREF %>admin/manageUserItem.reassignOwnership.grs?itemType=' + itemType + '&owned=' + owned +'&<%=ManageUserItemController.ITEM_REASSIGN_TO_OWNER_TOKEN%>=' + reassignTo;
alert(url);
window.opener.document.location = url;
window.close();
}

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

Thanks,
-Viidhya
Eric Pascarello
author
Rancher

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

CIT eh?

Eric
Viidhya Kishore
Ranch Hand

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

Yes
 
I agree. Here's the link: http://aspose.com/file-tools
 
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