Character Set Encoding in a Table
You need to make sure that when you are "storing the data in the database", the client you use is using utf8. Then setting the http header to utf8 completes the round trip.

The surprise is that it doesn't matter much what character set is used in the database (although it might well be convenient for that to be utf8 too).