Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>That's not true. What is true is that Ruby does not support <em>only</em> Unicode, it supports a whole slew of other encodings as well.</p> <p>This is in contrast to systems such as Java, .NET or Python, which follow the "One Encoding To Rule Them All" model. Ruby has what one of the designers of Ruby's m17n system calls a "CSI" model (Code Set Indepedent), which means that instead of all strings just having one and the same encoding, every string is tagged with its own encoding.</p> <p>This has some significant advantages both for ease of use and performance, because it means that if your input and output encodings are the same, you never need to transcode, whereas with the One True Encoding model, you need to transcode twice in the worst case (and that worst case unfortunately happens pretty often, because most of these environments chose an internal encoding that nobody actually uses), from the input encoding into the internal encoding and then to the output encoding. In Ruby, you need to transcode at most once.</p> <p>The basic problem with the OTE model is that whatever encoding you choose as the One True Encoding, it will be a completely arbitrary choice, since there simply isn't a single encoding that everybody, or even a majority, uses.</p> <p>In Java, for example, they chose UCS-2 as the One True Encoding. Then, a couple of years later, it turned out that UCS-2 was actually not enough to encode all characters, so they had to make a backwards-incompatible change to Java, to switch to UTF-16 as the One True Encoding. Except by that time, a significant portion of the world had moved on from UTF-16 to UTF-8. If Java had been invented a couple of years earlier, they would probably have chosen ASCII as the One True Encoding. If it had been invented in another country, it might be Shift-JIS. If it had been invented by another company, it might be EBCDIC. It's <em>really</em> completely arbitrary, and such an important choice <em>shouldn't</em> be.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload