From: "NARUSE, Yui" Date: 2009-02-11T22:16:19+09:00 Subject: [ruby-core:21987] Re: UTF-16BE is alias for UCS-2BE - is this correct? Hi, Rados�aw Bu�at wrote: > I've played with new encoding stuff from ruby1.9.1 and have noticed > that UTF-16BE is alias for UCS-2BE. I wonder if it's correct. > Wikipedia describes ucs-2 and utf-16 on one page but it's clearly > stated that ucs-2 is only 16bit subset of utf-16 so if I'm thinking > correctly not all characters represented by utf-16 could be > represented in ucs-2? Strictly it is of course incorrect. But we think "UCS-2BE" encoding is for old data that are tagged as UCS-2BE. Ruby 1.9.1 doesn't support output UCS-2BE. > I noticed it because I did some benchmarks and expected that ruby > optimize indexed access (String#[]) for fixed-length character > encodings but it looks like it doesn't do that for ucs-2: > (snip) > Should I file a bug for that? So this is intentional. -- NARUSE, Yui