<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML ><HEAD ><TITLE >Unicode and FreeTDS</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="FreeTDS User Guide" HREF="index.htm"><LINK REL="UP" TITLE="About Unicode, UCS-2, and UTF-8" HREF="aboutunicode.htm"><LINK REL="PREVIOUS" TITLE="Unicode Transformation Format: UTF-8" HREF="unicodeutf.htm"><LINK REL="NEXT" TITLE="GNU Free Documentation License" HREF="gfdl.htm"><LINK REL="STYLESHEET" TYPE="text/css" HREF="userguide.css"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"></HEAD ><BODY CLASS="SECTION" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" ><SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > User Guide: A Guide to Installing, Configuring, and Running <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN ></TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="unicodeutf.htm" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" >Appendix C. About Unicode, UCS-2, and UTF-8</TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="gfdl.htm" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="SECTION" ><H1 CLASS="SECTION" ><A NAME="UNICODEFREETDS" >Unicode and FreeTDS</A ></H1 ><P >Microsoft servers using TDS 7.0 and above (anything since SQL Server 6.5) transmit their data in UCS-2 format (16-bit integers). Because most applications linked to <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > are not prepared to deal with UCS-2 data, <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > can convert the data to something more acceptable, including <ACRONYM CLASS="ACRONYM" >ASCII</ACRONYM >. To do so, it employs an <SPAN CLASS="PRODUCTNAME" >iconv</SPAN > library. <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > determines the server's encoding from the TDS protocol and information reported by the server (generally per connection, but in the case of TDS 7.1, per result set column). It discovers the client's encoding in <TT CLASS="FILENAME" >freetds.conf</TT >. <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > will happily convert and convey your data in any <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >single-byte</I ></SPAN > format that <SPAN CLASS="PRODUCTNAME" >iconv</SPAN > can provide. In practice, this normally means some form of ISO 8859-x or UTF-8.</P ><P >At some future time, <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > aims to support Unicode and other multi-byte character sets. It does not do so at the current time.</P ><P >Sybase servers, by the way, adhere to a <SPAN CLASS="QUOTE" >"server makes right"</SPAN > policy: they transmit their data in whatever character set the client requested at login time. The list of available character sets is fairly short, but includes UTF-8. While <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN > <SPAN CLASS="emphasis" ><I CLASS="EMPHASIS" >could</I ></SPAN > convert Sybase data streams as easily as it does Microsoft data streams, to our knowledge no one is doing so. The Sybase server can perform the conversion itself, making <SPAN CLASS="PRODUCTNAME" >FreeTDS</SPAN >'s capability in this regard largely redundant and irrelevant.</P ><DIV CLASS="SECTION" ><H2 CLASS="SECTION" ><A NAME="MOREINFO" >For further information</A ></H2 ><P ></P ><TABLE BORDER="0" ><TBODY ><TR ><TD ><A HREF="http://www.cl.cam.ac.uk/~mgk25/unicode.html" TARGET="_top" >UTF-8 and Unicode FAQ for Unix/Linux</A >, by Markus Kuhn. As the man says, very comprehensive. </TD ></TR ><TR ><TD ><A HREF="http://www.wps.com/projects/codes/" TARGET="_top" >ASCII: American Standard Code for Information Infiltration</A >, by Tom Jennings. Everything you ever wanted know about ASCII, but didn't know whom to ask. </TD ></TR ><TR ><TD ><A HREF="http://tronweb.super-nova.co.jp/characcodehist.html" TARGET="_top" >A Brief History of Character Codes</A >, by Steven J. Searle. Includes useful references. </TD ></TR ><TR ><TD ><A HREF="http://www.unicode.org/" TARGET="_top" >Unicode Home Page</A >. </TD ></TR ></TBODY ></TABLE ><P ></P ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="unicodeutf.htm" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.htm" ACCESSKEY="H" >Home</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="gfdl.htm" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Unicode Transformation Format: UTF-8</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="aboutunicode.htm" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >GNU Free Documentation License</TD ></TR ></TABLE ></DIV ></BODY ></HTML >