0

In my web application, people can upload any file and view it later (or download, if it can't be displayed). Therefore, they are embedded in an HTML "object" tag. From the Java code (I use JSF 1.2) I get the necessary info (file path, mime type) and from them I construct the object via jQuery. This works fine ... except when there is a special symbol like ä, ö, ü etc. in the file name.

I need to use jQuery instead of directly getting the bean values because JSF always seems to return me numeric entities instead of ä, ö, ü etc. and I replace them. However, it still doesn't work. The browser URI encodes the file path and tries looking that up. URI encoding the value myself also changed nothing. (My encoding is ISO-8859-1).

So, to put it short: What must I do to be able to include a file that has a symbol like ä, ö ü in its filename in an HTML object tag? (As well as in an alternative download link, if the file can't be displayed)?

Mario Wagner
  • 98
  • 12

1 Answers1

0

You need to use some special characters for that, this site includes them all:

http://webdesign.about.com/library/bl_htmlcodes.htm

Ä = Ä
ä = ä
Ü = Ü
ü = ü

Got the system?

11684
  • 7,356
  • 12
  • 48
  • 71
  • Well, this is what I get from JSF already - I upload a file called ä.png and I get ä.png ... I can't put this in the data attribute oh HTML object tag, can I? At least it doesn't work with me. – Mario Wagner Nov 13 '12 at 16:20
  • ` ` should be perfectly valid. @MarioWagner – 11684 Nov 13 '12 at 16:23
  • Okay, it does not work with entities, but if I put URL encoded %E4.png, that seems to work. Obviously I was using a wrong function for encoding and that was the reason. – Mario Wagner Nov 13 '12 at 16:41
  • Okay, I think you got a point there. The _URL_ to a file should of course _URL_ encoded. – 11684 Nov 13 '12 at 16:42