JezK
Edit File: Unicode.html
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Unicode: East meets West</title><link rel="stylesheet" type="text/css" href="userguide.css" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="home" href="index.html" title="FreeTDS User Guide" /><link rel="up" href="AboutUnicode.html" title="Appendix C. About Unicode, UCS-2, and UTF-8" /><link rel="prev" href="ISO8859.html" title="ISO 8859: What everyone would like to forget" /><link rel="next" href="Unicodegoodbad.html" title="Unicode's Pluses and Minuses" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Unicode: East meets West</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ISO8859.html">Prev</a> </td><th width="60%" align="center">Appendix C. About Unicode, UCS-2, and UTF-8</th><td width="20%" align="right"> <a accesskey="n" href="Unicodegoodbad.html">Next</a></td></tr></table><hr /></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="Unicode"></a>Unicode: East meets West</h2></div></div></div><p><acronym class="acronym">ASCII</acronym> and its 8-bit cousins are on the way out, and with them the assumption that a character can be represented by a single byte. The new kid on the block is <a class="ulink" href="http://www.unicode.org/" target="_top">Unicode</a>, similar to but not precisely the same as ISO 10646. Unicode (despite its name) is a set of standards. The most widely implemented is the 16-bit form, called UCS-2. As you might guess, UCS-2 uses two bytes per character, allowing it to encode most characters of most languages. Because <span class="quote">“<span class="quote">most</span>”</span> is far from <span class="emphasis"><em>all</em></span>, there are nascent 32-bit forms, too, but they are neither complete nor in common use.</p><p>In the same sense that 7-bit <acronym class="acronym">ASCII</acronym> was extended to 8 bits, Unicode extends the most prevalent <span class="quote">“<span class="quote">8-bit <acronym class="acronym">ASCII</acronym></span>”</span>, <acronym class="acronym">ISO 8859-1</acronym>, to 16 and 32 bits. The first 256 values remain in Unicode as in <acronym class="acronym">ISO 8859-1</acronym>: 65 is still <code class="literal">A</code>, except instead of being 8 bits (0x40), it's 16 bits (0x0040). Unlike the 8-bit extensions, Unicode has a unique 1:1 map of numbers to characters, so no language context or <span class="quote">“<span class="quote">character set</span>”</span> name is needed to decode a Unicode string.</p><p>UCS-2 was the initial system employed by Microsoft NT-based systems while recent versions moved to UTF-16. Microsoft database servers store UCS-2/UTF-16 strings in <span class="type">nchar</span> and <span class="type">nvarchar</span> datatypes. Microsoft also designed version 7.0 (and up) of the <acronym class="acronym">TDS</acronym> protocol around UCS-2/UTF-16: all metadata (table names and such) are encoded according to these encoding on the wire.</p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ISO8859.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="AboutUnicode.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="Unicodegoodbad.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ISO 8859: What everyone would like to forget </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Unicode's Pluses and Minuses</td></tr></table></div></body></html>