Opened 4 years ago

Closed 4 years ago

#2218 closed bug (fixed)

Fix wrong charset coding

Reported by: shevek Owned by: shevek
Priority: major Milestone: 2.6
Component: BW Database Keywords:
Cc:

Description (last modified by shevek)

Reported in the bugs group:

http://www.bewelcome.org/groups/570/forum/s11729-Activity_can_t_be_described_with_national_characters

Further inestigation lead to several tables with wrong encoding.

Attachments (2)

20140623213434_t2218_table_collations_latin.php (5.0 KB) - added by Tsjoek 4 years ago.
20140624093326_t2218_table_collations_utf_general.php (19.4 KB) - added by Tsjoek 4 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 4 years ago by shevek

Add a phinx migration to alter the table:

ALTER TABLE activities CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;

comment:2 Changed 4 years ago by Tsjoek

Let's set ALL collations of tables and columns to utf8_unicode_ci at once. Apart from this kind of encoding stuff I'm running from time to time into not being able to compare two columns because the collation differs.

comment:3 Changed 4 years ago by shevek

Fine by me.

There are 22 hits on latin1 in the DB schema.

comment:4 Changed 4 years ago by Tsjoek

And 53 with one ore more columns in utf8_general_ci, and another 25 that don't carry any collations but have this as default nevertheless.

First step: change default collation for the database (possibly also for the server)

ALTER DATABASE databasename CHARACTER SET utf8 COLLATE utf8_unicode_ci

Followed by the migrations per table as I attached to this ticket. Note that the downward migration doesn't result in the exact original result, as it was too much work to recreate the mess.
To be obsoleted tables are not included, the list was already long enough this way. After their deletion there should not be any column or table-default with any other collation than utf8_unicode_ci

comment:5 Changed 4 years ago by shevek

  • Description modified (diff)
  • Summary changed from Activities aren't encoded in UTF-8 to Fix wrong charset coding

comment:6 Changed 4 years ago by Tsjoek

  • Component changed from BW Activities to BW Database
  • Status changed from new to local_testing

https://www.gitorious.org/bewelcome/rox/commit/fb83f0e00f1b873359c975bf633463f139bb45d0

Improved version committed. I'll leave the attachments for educational comparison :-)

comment:7 Changed 4 years ago by crumbking

  • Status changed from local_testing to to_alpha

tested locally

comment:8 Changed 4 years ago by shevek

  • Status changed from to_alpha to testing

comment:9 Changed 4 years ago by shevek

  • Status changed from testing to alpha

comment:10 Changed 4 years ago by shevek

  • Status changed from alpha to testing

comment:11 Changed 4 years ago by crumbking

Shouldn't this already applied to the db?

Closing?

comment:12 Changed 4 years ago by beatnickgr

  • Resolution set to fixed
  • Status changed from testing to closed

Closed, as crumbking requested. (not tested by me)

Note: See TracTickets for help on using tickets.