Defect #22618
closedsubject utf-8 char vs mysql2
Description
we have some problem submitting an "ő" character in the subject or in the body. without this char, the system working as intended.
relevant info from production.log: x.x.x.x at 2016-04-22 11:46:39 +0200
Processing by IssuesController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"some_token", "issue"=>{"is_private"=>"0", "tracker_id"=>"2", "subject"=>"szerződés", "description"=>"Az issue akkor zárható, ha a szerződés aláírásra került.", "status_id"=>"1", "priority_id"=>"2", "assigned_to_id"=>"1", "parent_issue_id"=>"", "start_date"=>"2016-04-22", "due_date"=>"2016-04-29", "estimated_hours"=>"2", "done_ratio"=>"70", "checklists_attributes"=>{"0"=>{"is_done"=>"0", "subject"=>"végleges ajánlat egyeztetése", "_destroy"=>"false", "position"=>"1", "id"=>""}, "1461318375687s"=>{"is_done"=>"0", "subject"=>"szükséges információk megküldése", "_destroy"=>"false", "position"=>"1", "id"=>""}, "1461318384837s"=>{"is_done"=>"0", "subject"=>"szerződés megkötése", "_destroy"=>"false", "position"=>"1", "id"=>""}}}, "was_default_status"=>"1", "continue"=>"Létrehozás és folytatás", "project_id"=>"xyz"}
Current user: admin (id=1)
Mysql2::Error: Incorrect string value: '\xC5\x91d\xC3\xA9s' for column 'subject' at row 1: INSERT INTO `issues` (`project_id`, `author_id`, `start_date`, `tracker_id`, `status_id`, `subject`, `description`, `priority_id`, `assigned_to_id`, `due_date`, `estimated_hours`, `done_ratio`, `updated_on`, `created_on`, `lock_version`) VALUES (1, 1, '2016-04-22', 2, 1, 'szerződés', 'Az issue akkor zárható, ha a szerződés aláírásra került.', 2, 1, '2016-04-29', 2.0, 70, '2016-04-22 11:46:39', '2016-04-22 11:46:39', 0)
Completed 500 Internal Server Error in 87ms (ActiveRecord: 41.1ms)
ActiveRecord::StatementInvalid (Mysql2::Error: Incorrect string value: '\xC5\x91d\xC3\xA9s' for column 'subject' at row 1: INSERT INTO `issues` (`project_id`, `author_id`, `start_date`, `tracker_id`, `status_id`, `subject`, `description`, `priority_id`, `assigned_to_id`, `due_date`, `estimated_hours`, `done_ratio`, `updated_on`, `created_on`, `lock_version`) VALUES (1, 1, '2016-04-22', 2, 1, 'szerződés', 'Az issue akkor zárható, ha a szerződés aláírásra került.', 2, 1, '2016-04-29', 2.0, 70, '2016-04-22 11:46:39', '2016-04-22 11:46:39', 0)):
app/models/issue.rb:175:in `create_or_update'
app/controllers/issues_controller.rb:141:in `create'
environment:
$ ruby bin/about sh: 1: svn: not found sh: 1: darcs: not found sh: 1: hg: not found sh: 1: cvs: not found sh: 1: bzr: not found Environment: Redmine version 3.0.7.stable Ruby version 1.9.3-p551 (2014-11-13) [x86_64-linux] Rails version 4.2.3 Environment production Database adapter Mysql2 SCM: Git 2.1.4 Filesystem Redmine plugins: progressive_projects_list 2.0.1 redmine_checklists 3.1.3 redmine_lightbox2 0.2.4 redmine_mentions 0.0.1 redmine_slack 0.1 time_logger 0.5.3
config:
production: adapter: mysql2 database: xxx host: localhost username: xxx password: "" encoding: utf8
Files
Related issues
Updated by Toshi MARUYAMA almost 10 years ago
- Status changed from New to Closed
- Resolution set to Invalid
Please use forum for question.
This is FAQ.
https://www.google.com/search?q=ActiveRecord%3A%3AStatementInvalid+%28Mysql2%3A%3AError%3A+Incorrect+string+value
http://stackoverflow.com/search?q=mysql+utf8
Updated by Marius BĂLTEANU over 6 years ago
- Related to Feature #31921: Changes to properly support 4 byte characters (emoji) when database is MySQL added