This project is archived and is in readonly mode.
I18n interpolation fails with multibyte strings on Ruby 1.9
Reported by Akira Matsuda | February 22nd, 2009 @ 12:56 AM
Current Rails I18n.interpolate fails with the following error when multibyte values given on Ruby 1.9.
incompatible character encodings: UTF-8 and ASCII-8BIT
This patch removes unnecessary force_encoding (which basically is not recommended to use), and enables interpolations between multibyte string and values. On the other hand, this patch stops caring about interpolations between two different multibyte encodings. (but who needs it?) Please look at the attached test cases for details.
Comments and changes to this ticket
-
DHH February 22nd, 2009 @ 03:15 PM
- Assigned user set to Sven Fuchs
-
Manfred Stienstra February 27th, 2009 @ 03:02 PM
The tests didn't run on Ruby 1.8 because Encoding isn't defined. Attached is a patch with running tests on both 1.8 and 1.9.
-
Sven Fuchs February 27th, 2009 @ 03:49 PM
Awesome. Thanks Manfred!
I've applied that patch to the I18n gem and bumped its version to 0.1.3
Attached is a patch that vendorizes that gem version to Rails.
PS: Unfortunately I'm not aware how to do it so that the Rails history gives proper credits to Akira :( The I18n history now does. Is there any way how I could keep Akira's original authorship?
-
Sven Fuchs February 27th, 2009 @ 04:09 PM
- no changes were found...
-
Manfred Stienstra February 27th, 2009 @ 04:11 PM
Nope, you can either credit your entire patch to Akira or not at all. Unfortunately Git doesn't allow you to set multiple authors for a commit. I assume they think commits should be small enough to be made by one author.
-
Repository February 27th, 2009 @ 04:15 PM
- State changed from new to committed
(from [943d64b1c857944666bff2572857abe866615274]) Vendorize i18n 0.1.3 gem (fixes issues with incompatible character encodings in Ruby 1.9) (Akira Matsuda) [#2038 state:committed]
Signed-off-by: David Heinemeier Hansson david@loudthinking.com http://github.com/rails/rails/co...
-
Jeremy Kemper February 27th, 2009 @ 04:42 PM
- Milestone cleared.
-
Akira Matsuda February 28th, 2009 @ 04:43 AM
Ah, sorry for the tests on Ruby 1.8.
Thank you for fixing that, Manfred.
And, thanks for the credit, Sven.
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>
People watching this ticket
Attachments
Referenced by
- 2038 I18n interpolation fails with multibyte strings on Ruby 1.9 (from [943d64b1c857944666bff2572857abe866615274]) Vendori...
- 2188 i18n fails with multibyte Strings in Ruby 1.9 (similar to #2038) This is the same error as in #2038, I did run this agains...
- 2188 i18n fails with multibyte Strings in Ruby 1.9 (similar to #2038) This is the same error as in #2038, I did run this agains...