Paste into wiki and save returns error on '\xC5\x81' characters

Added by Simon Z over 10 years ago

When I paste text from word and some other text editors into the wiki and hit save i get a 500 error.
It's obvious there are some characters that it dislike, is there a solution to this behavior?

I'm running this on the windows platform with redmine 0.8.4.

ActiveRecord::StatementInvalid (Mysql::Error: Incorrect string value: '\xC5\x81')\x0D\x0A...' for column 'text' at row 1:               UPDATE `wiki_contents`
              SET `version` = 6, `text` = 'h1. Ändra collation i EPiServer (eller annan databas)\r\n\r\n*Detta är endast testat på SQL Server 2005*\r\n\r\n* Skapa en ny databas, destinations databasen. Se till att du väljer rätt Collation (den nya,Finnish_Swedish_CI_AI om det är en svensk site).\r\n* Välj Generate SQL Script för databasen. Se till att alla index, nycklar m.m. är kryssade att de ska skriptas. O.B.S skripta drop statements. Se även till att Collation inte skriptas.\r\n* Kör det genererade skriptet på destinationsdatabasen.\r\n* Makera alla de första raderna som innehåller Foreign Keys i det genererade skriptet och kör de på destinationsdatabasen.\r\n* Kör Export Data från originaldatabasen till destinationsdatabasen. Välj endast tabeller och kör inte \"Optimize for many tables\". Markera alla tabeller som ska migreras och tryck på \"Edit mappings\" och kryssa i \"Enable identity insert\".\r\n* Makera alla de sista raderna som innehåller Foreign Keys i det genererade skriptet och kör de på destinationsdatabasen.\r\n\r\n\r\n*Try out collations*\r\nFollowing test script is based on this article http://www.sqlug.se/forums/ShowPost.aspx?PostID=208\r\nSorting and comparison problems that this test script shows is commented here http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=415171\r\n\r\nLatin1 makes Å appear before A. Finnish_Swedish_CI_AI makes v and w be treated equal.\r\n\r\n<pre>\r\n<pre>\r\nDECLARE @Latin1_General_CI_AI TABLE ( \r\nLatinCIAI int IDENTITY(1,1) NOT NULL, \r\nLetter nvarchar(3) COLLATE Latin1_General_CI_AI\r\n) \r\n\r\nDECLARE @Finnish_Swedish_CS_AS TABLE ( \r\nCSAS int IDENTITY(1,1) NOT NULL, \r\nLetter nvarchar(3) COLLATE Finnish_Swedish_CS_AS \r\n) \r\n\r\nDECLARE @Finnish_Swedish_CS_AI TABLE ( \r\nCSAI int IDENTITY(1,1) NOT NULL, \r\nLetter nvarchar(3) COLLATE Finnish_Swedish_CS_AI \r\n) \r\n\r\nDECLARE @Finnish_Swedish_CI_AS TABLE ( \r\nCIAS int IDENTITY(1,1) NOT NULL, \r\nLetter nvarchar(3) COLLATE Finnish_Swedish_CI_AS \r\n) \r\n\r\nDECLARE @Finnish_Swedish_CI_AI TABLE ( \r\nCIAI int IDENTITY(1,1) NOT NULL, \r\nLetter nvarchar(3) COLLATE Finnish_Swedish_CI_AI \r\n) \r\n\r\n\r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'å\') \r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'a\') \r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'A\') \r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'á\') \r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'a\') \r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'A\') \r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'á\') \r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'Å\') \r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'L\') \r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'Ł\')\r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'d\')\r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'e\')\r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'f\')\r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'ę\')\r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'w\')\r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'v\')\r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'vel\')\r\nINSERT INTO @Latin1_General_CI_AI (Letter) VALUES (N\'wel\')\r\n\r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'å\') \r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'a\') \r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'A\') \r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'á\') \r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'a\') \r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'A\') \r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'á\') \r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'Å\') \r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'L\') \r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'Ł\')\r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'d\')\r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'e\')\r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'f\')\r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'ę\')\r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'w\')\r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'v\')\r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'vel\')\r\nINSERT INTO @Finnish_Swedish_CI_AI (Letter) VALUES (N\'wel\')\r\n\r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'å\') \r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'a\') \r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'A\') \r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'á\') \r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'a\') \r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'A\') \r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'á\') \r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'Å\') \r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'L\') \r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'Ł\')\r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'d\')\r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'e\')\r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'f\')\r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'ę\')\r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'w\')\r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'v\')\r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'vel\')\r\nINSERT INTO @Finnish_Swedish_CI_AS (Letter) VALUES (N\'wel\')\r\n\r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'å\') \r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'a\') \r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'A\') \r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'á\') \r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'a\') \r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'A\') \r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'á\') \r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'Å\') \r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'L\') \r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'Ł\')\r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'d\')\r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'e\')\r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'f\')\r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'ę\')\r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'w\')\r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'v\')\r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'vel\')\r\nINSERT INTO @Finnish_Swedish_CS_AI (Letter) VALUES (N\'wel\')\r\n\r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'å\') \r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'a\') \r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'A\') \r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'á\') \r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'a\') \r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'A\') \r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'á\') \r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'Å\')\r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'L\') \r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'Ł\')\r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'d\')\r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'e\')\r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'f\')\r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'ę\')\r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'w\')\r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'v\')\r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'vel\')\r\nINSERT INTO @Finnish_Swedish_CS_AS (Letter) VALUES (N\'wel\')\r\n\r\nSELECT * FROM @Latin1_General_CI_AI ORDER BY Letter ASC\r\nSELECT * FROM @Finnish_Swedish_CI_AI ORDER BY Letter ASC\r\nSELECT * FROM @Finnish_Swedish_CI_AS ORDER BY Letter ASC\r\nSELECT * FROM @Finnish_Swedish_CS_AI ORDER BY Letter ASC\r\nSELECT * FROM @Finnish_Swedish_CS_AS ORDER BY Letter ASC\r\nSELECT * FROM @Finnish_Swedish_CS_AI WHERE Letter = \'a\' ORDER BY Letter ASC\r\nSELECT * FROM @Finnish_Swedish_CS_AS WHERE Letter = \'a\' ORDER BY Letter ASC\r\nSELECT * FROM @Finnish_Swedish_CI_AS WHERE Letter = \'L\' ORDER BY Letter ASC\r\nSELECT * FROM @Finnish_Swedish_CI_AS WHERE Letter = \'Ł\' ORDER BY Letter ASC\r\nSELECT * FROM @Finnish_Swedish_CI_AI WHERE Letter = \'L\' ORDER BY Letter ASC\r\n</pre>\r\n</pre>', `updated_on` = '2009-09-30 09:13:27'
              WHERE id = 130
              AND `version` = 5
):
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:147:in `log'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:302:in `execute'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:167:in `update_sql'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb:317:in `update_sql'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:49:in `update_without_query_dirty'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:19:in `update'
    /vendor/rails/activerecord/lib/active_record/locking/optimistic.rb:81:in `update_without_dirty'
    /vendor/rails/activerecord/lib/active_record/dirty.rb:142:in `update_without_callbacks'
    /vendor/rails/activerecord/lib/active_record/callbacks.rb:234:in `update_without_timestamps'
    /vendor/rails/activerecord/lib/active_record/timestamp.rb:38:in `update'
    /vendor/rails/activerecord/lib/active_record/base.rb:2483:in `create_or_update_without_callbacks'
    /vendor/rails/activerecord/lib/active_record/callbacks.rb:207:in `create_or_update'
    /vendor/rails/activerecord/lib/active_record/base.rb:2211:in `save_without_validation'
    /vendor/rails/activerecord/lib/active_record/validations.rb:911:in `save_without_dirty'
    /vendor/rails/activerecord/lib/active_record/dirty.rb:75:in `save_without_transactions'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:106:in `save'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:66:in `transaction'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:79:in `transaction'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:98:in `transaction'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:106:in `save'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:118:in `rollback_active_record_state!'
    /vendor/rails/activerecord/lib/active_record/transactions.rb:106:in `save'
    /vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:173:in `send'
    /vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:173:in `method_missing'
    /app/controllers/wiki_controller.rb:84:in `edit'
    /vendor/rails/actionpack/lib/action_controller/base.rb:1166:in `send'
    /vendor/rails/actionpack/lib/action_controller/base.rb:1166:in `perform_action_without_filters'
    /vendor/rails/actionpack/lib/action_controller/filters.rb:579:in `call_filters'
    /vendor/rails/actionpack/lib/action_controller/filters.rb:572:in `perform_action_without_benchmark'
    /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    c:/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
    /vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
    /vendor/rails/actionpack/lib/action_controller/rescue.rb:201:in `perform_action_without_caching'
    /vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:13:in `perform_action'
    /vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb:33:in `cache'
    /vendor/rails/activerecord/lib/active_record/query_cache.rb:8:in `cache'
    /vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb:12:in `perform_action'
    /vendor/rails/actionpack/lib/action_controller/base.rb:529:in `send'
    /vendor/rails/actionpack/lib/action_controller/base.rb:529:in `process_without_filters'
    /vendor/rails/actionpack/lib/action_controller/filters.rb:568:in `process_without_session_management_support'
    /vendor/rails/actionpack/lib/action_controller/session_management.rb:130:in `process'
    /vendor/rails/actionpack/lib/action_controller/base.rb:389:in `process'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:149:in `handle_request'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:107:in `dispatch'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `synchronize'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:104:in `dispatch'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:120:in `dispatch_cgi'
    /vendor/rails/actionpack/lib/action_controller/dispatcher.rb:35:in `dispatch'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/rails.rb:76:in `process'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/rails.rb:74:in `synchronize'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/rails.rb:74:in `process'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:159:in `process_client'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:158:in `each'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:158:in `process_client'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:285:in `run'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:285:in `initialize'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:285:in `new'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:285:in `run'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:268:in `initialize'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:268:in `new'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel.rb:268:in `run'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:282:in `run'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:281:in `each'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/configurator.rb:281:in `run'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:128:in `run'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/../lib/mongrel/command.rb:212:in `run'
    c:/ruby/lib/ruby/gems/1.8/gems/mongrel-1.1.5-x86-mswin32-60/bin/mongrel_rails:281
    c:/ruby/bin/mongrel_rails:16:in `load'
    c:/ruby/bin/mongrel_rails:16

Rendering E:/redmine/public/500.html (500 Internal Server Error)