in reply to Re^8: best sort
in thread best sort
As for knowing what sort of data content you have, that has never been Unicode’s job. That is something one must relegate to a higher-level protocol. It’s just like with receiving a file over the web. If you expect to know what to do with the file, then you need various bits of metadata to know how to handle it. If someone sends you a file but doesn’t tell you what’s in it, that’s a personal problem. It’s not a Unicode problem at all. You have a social problem, which is something else altogether. You need a better higher-level protocol is all.
That said, because Unicode was both exceedingly careful and also reasonably clever about how it defined its approved variable‐width serialization schemes, I have no trouble in the world at all knowing which of the three I have:
$ perl -CS -S unichars Singleton > sample-one $ iconv -f UTF-8 -t UTF-16 < sample-one > sample-two $ iconv -f UTF-8 -t UTF-32 < sample-one > sample-three $ file sample-{one,two,three} sample-one: UTF-8 Unicode text sample-two: Little-endian UTF-16 Unicode text sample-three: Unicode text, UTF-32, little-endian
There aren’t many different flavors of Unicode as you frequently allege. There can be only one. That’s what the “uni” part is about. That’s why things like Perl and XML and HTML are always all Unicode, all the time: because it always means the same thing. It makes no matter whether you say chr(233) in Perl, é in HTML, or é in XML. Those are always the same character, because the Unicode mapping of assigned code points to characters is always the same and guaranteed never to change. And that character is always LATIN SMALL LETTER E WITH ACUTE. Similarly, something like HTML’s é always maps to Unicode code point 233. It’s not like the same character is a code point 142 on a Mac and code point 221 on NextStep. That would be wrong. That’s why modern systems like Perl and HTML and XML are 100% Unicode: so that assigned code points always mean the same character. There is only one flavor of Unicode, or it wouldn’t be Unicode.
I suppose you might stump for Unicode 6.0 being a different flavor from Unicode 5.0, but that seems to be putting too fine a point on it. In any event, the strong stability guarantees Unicode avoid train wrecks in that arena.
Which is quite all the time I have for a belligerent anonymous coward, and then some.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: best sort
by BrowserUk (Patriarch) on Aug 18, 2011 at 01:45 UTC | |
by tchrist (Pilgrim) on Aug 18, 2011 at 16:24 UTC | |
by BrowserUk (Patriarch) on Aug 18, 2011 at 18:18 UTC |