#3184 closed defect (bug) (duplicate)
UTF8 DB connections preferred
Reported by: | agharbeia | Owned by: | markjaquith |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.0.4 |
Component: | Administration | Keywords: | DB connection encoding UTF8 needs-patch |
Focuses: | Cc: |
Description
There should be an option to affirmatively change the encoding of the database connection to something other than the database server's default.
Many hosts leave their servers at the default of MySQL which is 'latin1' with the 'sewdidh_ci collation'. This messes up many non-Latin-script blogs.
The current solution is to manually add a "mysql_query("SET NAMES utf8 COLLATE utf8_unicode_ci");" statement or similar in wp-db.php which may later get overwritten when upgrading, which complicates things further.
It may be useful to make the default value of this suggested option to actually be UTF8 since it cannot harm Latin-script languages but will be more straightforward for others. Obviously some other people will still need to change the value of this option to have their language scripts correctly encoded and avoid future problems, but it will be a straightforward process by then, instead to have to annually patch the code.
Change History (8)
#1
@
17 years ago
- Keywords needs-patch added
- Milestone set to 2.2
- Owner changed from anonymous to markjaquith
- Status changed from new to assigned
#5
@
17 years ago
- Resolution set to duplicate
- Status changed from assigned to closed
Duplicate of #2828.
I think making this as a constant option is a bad idea. SET NAMES statement is so powerful to change MySQL behavior that it should be used only when we know what we are doing.
Sounds like a good candidate for a PHP constant option. Can't be an option in the database, as you need it before you connect to the database.