Question

I've noticed that in Drupal after some users enter content into the body of a node, characters like quotes and apostrophes get saved as: ’ “

This is due the user entering odd characters or something...

  1. Does this mean the Drupal database hasn't been configured for utf8?
  2. How can this be corrected so ’ is actually saved as just '?

UPDATE Turns out, in my case, the decoded characters were a results of my downloading the Drupal mysql database dump which gets saved as ascii and loading that into Mysql to repopulate the database. This happened twice, once when I migrated hosting and the second time when I messed up the DB and had to restore is manually.

The solution is you are using the Drupal Backup and Migrate module and you download the backup file and have to restore manually is to convert the file in notepad or whatever from ascii into utf8. I tested this and it works.

Was it helpful?

Solution

’ “ is the UTF-8 encoding of ’ “ misinterpreted as windows-1252 (not latin-1).

Does this mean the Drupal database hasn't been configured for utf8?

That's one possibility. Others are:

  • The program that puts data in the database is broken.
  • The program that retrieves data from the database is broken.

OTHER TIPS

  1. Does this mean the Drupal database hasn't been configured for utf8?

I'd say it's the most likely possibility that the database table(s) are set to latin1. Take a look. Alternatively, it could also be that the database connection is not UTF-8 encoded (sending a SET NAMES utf8; query sometimes helps.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top