image with foreign characters in name won't display

[nobr]I have an image on my drive whose name has foreign characters ("c髉ia de frente.jpg"). To display the image my JSP reads the image name from the database and generates the following html:

<img src="../pictures/c髉ia de frente.jpg">

The page then displays a broken image icon for this image. Images in the same list which do not have foreign chars get displayed accurately. When I choose "show image.." in my browser I see that the image name has been rewritten into the following: c%C3%B3pia%20de%20frente.jpg. The rewriting that will display the image is instead c%F3pia%20de%20frente.jpg. I found the correct rewriting on another of my JSP where the image with the foreign chars actually gets displayed correctly although the code to generate the html is the same on both pages and looks something like this (simplified):

<logic:iterate id="listelement" name="list" property="rows" scope="request" type="org.apache.commons.beanutils.DynaBean">

<%

out.write("<img src=\"../pictures/"+listelement.get("name").toString()+"\">");

%> <br>

</logic:iterate>

Every image that doesn't have foreign chars in its name gets displayed accurately but images with foreign chars in their names won't display. What am I doing wrong?

Thanks

Niklas[/nobr]

[1578 byte] By [Niklasa] at [2007-10-3 1:37:52]
# 1
USE UTF-8 encodingreplace character foreign with %HEXCODEEXAMPLE ?= %E9?= %F3try replacing:<img src="../pictures/c%F3pia de frente.jpg">
andresurbinaa at 2007-7-14 18:36:03 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Thanks, but it doesn't seem necessary to replace foreign characters. It works without replacing in one place but not in another which is confusing. I think it is something with the enconding but can't see what the difference is between the working and non-working code. In both pages I have put <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

I'd greatly appreciate any more suggestions to solve this problem.

Niklasa at 2007-7-14 18:36:03 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...