[buddypress-trac] [BuddyPress] #1445: Forums install as latin1 not utf8

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Sun Dec 13 00:31:02 UTC 2009


#1445: Forums install as latin1 not utf8
----------------------+-----------------------------------------------------
Reporter:  DJPaul     |       Owner:     
    Type:  defect     |      Status:  new
Priority:  major      |   Milestone:  1.2
Keywords:  confirmed  |  
----------------------+-----------------------------------------------------

Comment(by DJPaul):

 Looking into the latter issue (how to fix the DB type for existing
 installs):

 Tables need to be changed, something like:
 ALTER TABLE $table DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci

 Any binary columns need to change, something like.  I think text fields
 are OK but someone needs to read the MySQL documentation carefully to
 confirm, don't take my word for it.
 ALTER TABLE $table CHANGE $field_name $field_name $field_type CHARACTER
 SET utf8 COLLATE utf8_bin

 It is possible to store UTF8 data in a non-UTF8 database.  I think looking
 at BuddyPress (&WPMU), this will be the case.  If it were non-UTF8 data in
 a non-UTF8 database, to convert that to UTF8, the process seems to be to
 convert everything to a binary type, change the charset, then switch it
 back.

 In a nutshell I think we can just do a ALTER TABLE $table DEFAULT
 CHARACTER SET and bob's your uncle.

-- 
Ticket URL: <http://trac.buddypress.org/ticket/1445#comment:1>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list