[opencms-dev] XML Content Editor Not Saving Special Characters Correctly

Brett Sheeran brett.sheeran at gmail.com
Thu Apr 16 06:05:20 CEST 2009


Hi,

I have a problem with the XML Content editor not saving special
characters correctly. However, I can save the same characters in the
same XML file if I use "Edit Control Code". Can anyone help please?
Details as follows.

I find that if I save a special character in the XML content editor,
(in particular the pound "£" character), the XML content editor seems
to append an extra character so the value stored becomes "£".

I am using OpenCMS 7.0.5 and MySQL 5.1. It appears to me that
everything on my system is set up for UTF-8.

The JDBC connection is configured thus:
db.pool.default.jdbcUrl.params=?characterEncoding\=UTF-8

In the <head> of the editor page, I see the following metatag:
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

I ran a sniffer on the submit. I see this string in the request header:
Content-Type: application/x-www-form-urlencoded

And this string in the response header:
Content-Type: text/html;charset=UTF-8

The *really* strange thing is that if I use "Edit Control Code" to
edit the same XML file I can save the special characters correctly.

Saving the special character as a code "£" will only work once
because the second time I am saving the "£" character again.

As a temporary workaround, I use "Edit Control Code" to remove the "Â"
characters.

Incidentally, a former colleague "skinned" a few OpenCMS JSPs. If
anyone thinks that might be a problem, I would be interested to know
which JSPs are associated with the XML Content Editor. I am wondering
if there should be a tag like this in a JSP somewhere:
<%@ page pageEncoding="UTF-8" %>

Thank you.

Regards BrettS



More information about the opencms-dev mailing list