Quote:
|
Originally Posted by shamalive
eh?
|
Eh is right!!!!
Found out its not a javascript issue..........Its a Tomcat issue............... Boy is my face red.....
Strange Characters at the beginning of every JSP page
Author:
webmaster2004-06-29 06:15:22 Several people have reported that the get some strange characters like "" at the begining of every JSP page when using Tomcat 5.0.
These strange characters are the Unicode header for UTF-8 encoded files.
For an unknown reason, some (not all) Tomcat versions do not recognize properly UTF-8 files and send the strange characters to the client browser.
We have been unable to fix this problem, being the only solution changing all the JSP to ISO-8859-1 encoding.
This problem only affects 2.0.x versions since 1.x pages are already encoded as ISO-8859-1.
One solution is replacing UTF-8 included files from /methods directory by ASCII versions. The ASCII files are available at
Patch 2.0.13
There is also another ISO-8859-1 full JSP replacement patch for v2.0.12 that can be downloaded from
http://www.hipergate.org/dist/hipergate/patches/ just unzip the patch and overwrite the original 2.0.12 files with the ones from the patch.
For converting another JSP pages from UTF-8 to ISO-8859-1 you must:
1st) Replace contentType="text/html;charset=UTF-8" with contentType="text/html;charset=ISO-8859-1" at the beginning of each page.
2nd) Run this re-encoding routine:
String [] files = new String[] {"addrbook/adrbkhome.jsp", "addrbook/editfellowtitle.jsp" ,...};
com.knowgate.dfs.Fil eSystem oFS = new com.knowgate.dfs.Fil eSystem();
String sBase = "/opt/knowgate/web-iso/";
String sFile;
int iFiles = files.length;
for (int f=0; f<iFiles; f++) {
sFile = oFS.readfilestr(sBas e+files[f], "UTF-8");
oFS.writefilestr(sBa se+files[f], sFile, "ISO-8859-1");
}
Finally, you can also remove UTF-8 prolog characters from all JSP files with this script courtesy of Lorenzo López
#!/bin/bash
for i in `grep "" * -R | cut -f1 -d:` ; do
cat $i | tr "" ' ' > $i.new
mv $i.new $i
done
The script must be executed from the same directory where hipergate is installed (for example tomcat/webapps/hipergate).