• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Encoding an URL

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have problem while trying to Encode an URL:
<a href="test.jsp?arg=<%= value %>">Link name</a>

The variable "value" that is transmited can contain some specific characters or foreign characters. So I tried to encode the URL:
<a href="test.jsp?arg=<%= URLEncoder.encode(value, "UTF-8") %>">Link name</a>

It works with specific characters (like %@& ...) but not with foreign characters.

What should I add?
[ June 21, 2006: Message edited by: Pierre Peron ]
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is very hard to say without knowing what the problem is. Could you provide some information about what "works" means?
 
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
did you try response.encodeRedirect("some url")
 
reply
    Bookmark Topic Watch Topic
  • New Topic