1

I'm running a webapp from amazon rds with tomcat 7 and spring, which uses hibernate as the persistence layer. The application and utf-8 encoding work properly on localhost, but for some reason when I deploy to amazon, the UTF-8 encoding breaks.

I use mysql 5.5.27 on amazon rds and the table that we wish to update has collation set to utf8 - utf8_unicode_ci

And in hibernate I have set: < prop key="hibernate.connection.charSet">UTF-8

UTF-8 characters get replaced by ??? and this is of course especially bad for passwords and usernames + email as it basically kills them.

Anyone else encountered character encoding breaking when deploying to amazon?

MadHatter
  • 78,442
  • 20
  • 178
  • 229
TeraTon
  • 111
  • 2

1 Answers1

1

The easiest solution is in the below link:

https://stackoverflow.com/a/22940024/2146313

I've tried and succeeded.

The solution is essentially:

Create a new Parameter Group in RDS. What I changed was character_set_* and collation_*. There are about 8 settings, I changed all of them to utf8 and utf8_unicode_ci. Then assign your DB instance to use this new parameter group.

volatilevar
  • 121
  • 2
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – masegaloeh Sep 23 '14 at 01:42
  • @masegaloeh, Thanks for the reminder. I've updated the post. – volatilevar Sep 23 '14 at 06:17