[opencms-dev] Problems through Byte-Order Mark

Yves Glodt yg at mind.lu
Wed Feb 4 10:55:00 CET 2009


thank you all for your suggestions and sorry for terrorizing the ml with my 
requests...! :-)

I eventually found today the source of my "certain jsps are corrupted", which 
I suspected to be a bom-issue.

In fact, one of my templates included 2 other jsps. All of the files have a 
bom, but one of them seemed to have a different one. I could e.g. also not open 
this file via webdav, but all the other jsps worked fine.

As suggested quite early in this thread, I just copy/pasted from the 
workplace-editor to a text editor on my box, saved, and re-copy/pasted back, 
saved and it's ok now.

The beginning of the sill bad jsp looked like this:
���<%@ page session="true" %>

The good one:
<%@ page session="true" %>


The good one still contains a BOM, as I verified by opening it with a hex 
editor.

Thanks again for all the suggestions,

Best regards,
Yves



On Sunday 01 February 2009, Philip Kuegler wrote:
> I do know similar issues, but not with openCMS yet. When creating jsp's
> for tomcat for plain delivery (no framework used) I once had to play
> around with page encoding. The pages did not only contain "hardcoded"
> jsp code, but also content that was fetched in-time from 3rd party
> interfaces and xml files from disk. In fact I had two problems:
>   1.) The Strings that built up the page did have different encodings.
>   2.) The system language (default OS file encoding) was set to "c"
> which in fact has been 8bit ascii and not UTF-8 (e.g. declare -x
> LANG="en_US.UTF-8")
>   3.) Tomcat was to set deliver ISO-8859-1 encoded pages by default.
>
> I did mostly end up with either UTF-8 characters interpreted as 1 Bit
> chars  or characters that were encoded twice (1 UTF-8 char was encoded
> to 2 UTF-8 chars as both bytes from the original UTF-8 were encoded again).
>
> Did you change the default encoding somewhere?
> Did you set the "page-encoding" (or similar) directives on any jsp pages
> or in the opencms properties?
> Did copying the content to a new empty file solve the problem (does the
> new file cause the same issues)?
> Are there any npc (non-printable-characters) somewhere in the jsp code
> that might create these issues (ignored by the gui, but messing up the
> layout)?
>
> Can you provide a stand alone example of the jsp?
>
> br,
> Philip
>
> Yves Glodt wrote:
> > [...]
> > I have another site which I host in my opencms instance, whose jsps
> > also have a BOM when I check them with the hex editor, but which do
> > *NOT* have them any more when I fetch the html files with wget.
> >
> >
> > In my first site, the one which made me post on this list about the
> > BOM, the jsp which contain the BOM mess up the layout (no I did not
> > smoke anything today). They insert a blank line in several spaces in
> > the layout.
> >
> >
> > So in the meantime I am not sure any more that the BOM causes a direct
> > problem to my content, since all of the jsp seem to contain it when
> > accessed in the vfs.
> >
> >
> > But, the BOM seems in some cases be included in the pages when opencms
> > serves them, and this seems to create a problem for me... Anyone
> > having an idea where the "served BOM" could come from ?
> >
> >
> > regards,
> > Yves
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20090204/73755c41/attachment.htm>


More information about the opencms-dev mailing list