This project is archived and is in readonly mode.
I18n incompatible character encodings: UTF-8 and US-ASCII
Reported by qoobaa | March 3rd, 2010 @ 11:05 AM | in 2.3.10
There's a problem with new I18n 0.3.5 gem and Rails 2.3.5. I18n tries to preserve string encoding in interpolation method, but some strings are hardcoded into Rails and have US-ASCII encoding. The key activerecord.errors.full_messages.format ("{{attribute}} {{message}}") is hardcoded in validations.rb file, and it needs to be UTF-8 encoded to work with other UTF-8 strings.
Comments and changes to this ticket
-
Rizwan Reza March 26th, 2010 @ 09:36 AM
- Milestone set to 2.3.6
Hi Jakub, Can you provide a patch for this? Thanks.
-
qoobaa March 26th, 2010 @ 09:59 AM
The problem can be easily solved by defining custom "activerecord.errors.full_messages.format" key in your translations:
de: activerecord: errors: full_messages: format: "{{attribute}} {{message}}"
I don't have time to make a patch right now, but it'd be really simple - all you need is to add magic comment with utf-8 encoding at the beginning of validations.rb file.
-
Lailson Bandeira March 26th, 2010 @ 11:36 AM
For me, none of these solutions worked in Rails 3:
* Add the "activerecord.errors.full_messages.format" key on translation file * Add # coding: utf-8 in validations.rb I'm using a portuguese translation and Rails 3.0.0beta0 on Ruby 1.9.1p378 on Mac OS X 10.6. -
Lailson Bandeira March 26th, 2010 @ 11:37 AM
Let me format this:
For me, none of these solutions worked in Rails 3:
- Add the "activerecord.errors.full_messages.format" key on translation file
- Add # coding: utf-8 in validations.rb
I'm using a portuguese translation and Rails 3.0.0beta0 on Ruby 1.9.1p378 on Mac OS X 10.6.
-
Lailson Bandeira April 2nd, 2010 @ 08:52 PM
Sorry, I just found out there is already the ticket #3941 for this problem on Rails 3. And it just got solved!
-
Rizwan Reza April 3rd, 2010 @ 02:43 PM
- State changed from new to resolved
-
Priit Tamboom June 5th, 2010 @ 07:41 PM
- Assigned user set to Rizwan Reza
Actually it's only resolved for Ralis3 but it's not solved for 2.3.8 or 2-3-stable branch and I just got bitten by it. It got some hours debugging for me to figure out where US-ASCII string comes in.
Anyhow, I made micro-patch against 2-3-stable and this problem should be solved now.
-
Priit Tamboom June 5th, 2010 @ 07:45 PM
- Title changed from I18n incompatible character encodings: UTF-8 and US-ASCII to [PATCH] I18n incompatible character encodings: UTF-8 and US-ASCII
-
Santiago Pastorino June 6th, 2010 @ 04:42 AM
- Milestone changed from 2.3.6 to 2.3.9
- State changed from resolved to open
-
Rizwan Reza June 6th, 2010 @ 10:33 AM
- Assigned user cleared.
-
Jeremy Kemper August 30th, 2010 @ 02:28 AM
- Milestone changed from 2.3.9 to 2.3.10
- Importance changed from to Low
-
Jeff Kreeftmeijer October 10th, 2010 @ 01:01 PM
- Title changed from [PATCH] I18n incompatible character encodings: UTF-8 and US-ASCII to I18n incompatible character encodings: UTF-8 and US-ASCII
- Tag set to i18n, patch
Using the "patch" tag instead of prefixing the ticket title with "[PATCH]" to make sure patched tickets end up in the open patches bin. :)
-
Santiago Pastorino October 10th, 2010 @ 05:27 PM
- Assigned user set to José Valim
-
José Valim November 11th, 2010 @ 04:22 PM
- State changed from open to resolved
This is fixed in I18n 0.4.2.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>