Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Brian Russell
Character Encoding on various Portlets
May 16, 2012 3:55 PM
Answer

Brian Russell

Rank: Junior Member

Posts: 40

Join Date: October 31, 2011

Recent Posts

Are there differences in character encoding in the Web Content portlet vs other portlets like Blogs, Calendar, Wiki, Message Boards?

I have noticed that when editing Journal content, I can insert special UTF-8 characters from the "Insert Special Character" icon in the CKeditor, and they will persist after being saved to the database. But if I do the same in a Blog entry, Wiki page, Calendar event, or any other location where the rich text editor is available, the characters do not persist and end up being converted to the incorrect (I'm guessing latin1) characters.

Example of special character: … or Ê
Results in the characters: … or Ê

I do not believe it has anything to do with the database character encoding settings, because the following scenario still results in the incorrect characters:
  1. Add a new Blog Entry
  2. Add a special character in the body content.
  3. Attempt to publish the page without filling in a title.
  4. An error will be returned that the title is required, and now the special character is converted to garbled characters.

This should all occur before reaching the persistence layer, so I would think it has to do with either the ckeditor implementation or the action (note: I use the same ckeditor implementation for Journal content)

Our Platform Setup
Rackspace Cloud: Red Hat Enterprise 5.5 x86_64 (8g RAM)
Liferay 6.1.0 CE
Tomcat 7.0.23
MySQL 5.5.20 (server, liferay db and all tables are UTF-8)
Java 1.6.0_31
Relevant JVM Options: -Dfile.encoding=UTF-8

If anybody has any insights on anything I can do to fix this so that it is consistent across all content entry, I would appreciate the help! Thank you!
Brian Russell
RE: Character Encoding on various Portlets
June 19, 2012 8:26 AM
Answer

Brian Russell

Rank: Junior Member

Posts: 40

Join Date: October 31, 2011

Recent Posts

Well, I solved my issue. It appears all of my troubles stemmed from the fact that I had disabled the built in CASFilter. I did this under the recommendation that any filters that are not being used should be disabled. We are using our own implementation of CAS, and do not need or want the built in CAS Filter running. So I set the appropriate portal-ext property:

com.liferay.portal.servlet.filters.sso.cas.CASFilter=false

It turns out that "something" else, presumably another filter in the chain, requires that filter to be active. My guess is that it is being used to place other filters in the chain in a particular position before/after CASFilter. But I could be completely wrong.

I still do not have any idea what the actual root cause of the character encoding issues was, but I do know that setting that property back to true solved my issue, so I'm moving on!