|
|
|
SearchCategories
Books by the AuthorTwitter AccountOther Ruby Projects |
Ruby 1.8 Character Encoding Flaws
Posted over 3 years ago
in Character Encodings.
This is the seventh post in my series on Character Encodings. Please see the table of contents for the series if you have not yet read the previous posts. Now that we have toured the entire landscape of Ruby 1.8's encoding support, we need to discuss the problems the system has. These long standing issues are what pushed the core team to build the multilingualization (m17n) implementation for Ruby 1.9. The main problems are:
I imagine most of those are pretty straightforward, but let's talk through them just to make sure we learn from the mistakes of the past. I'm pretty sure this will make it easier to understand why things are the way they are in Ruby 1.9. The "not enough encodings" complaint should be the most obvious of all. Ruby 1.8 supports four and one is just no encoding. That means you really only get UTF-8 and two Asian encodings. The UTF-8 support is how we've managed to make it this far, but there are a ton of common encodings that just aren't covered. The most important thing to realize here though is that we can't just keep adding encodings to Ruby 1.8. The system wasn't designed with that in mind. We will run out of letters to tack onto the end of a Once we have more encodings, it's time to get serious about wider support. Finally, one giant encoding switch is dangerous. There are several places where you need to know an encoding: the data in a Again, I just wanted highlight these issues, because I think it will help clarify why things are changing in Ruby 1.9. As we now dig into Ruby 1.9 encodings keep an eye out for these specific flaws and how they are being addressed… |
|
|
|