JezK
Edit File: locales.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>The locales.conf file</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="install.html" title="Chapter 3. Install FreeTDS" /><link rel="prev" href="freetdsconf.html" title="The freetds.conf file" /><link rel="next" href="envvar.html" title="Environment variables" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The <code class="filename">locales.conf</code> file</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="freetdsconf.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Install <span class="productname">FreeTDS</span></th><td width="20%" align="right"> <a accesskey="n" href="envvar.html">Next</a></td></tr></table><hr /></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="locales"></a>The <code class="filename">locales.conf</code> file</h2></div></div></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="localespurpose"></a>What it does</h3></div></div></div><p>For an English-speaking American, not much. <span class="productname">FreeTDS</span> originated in the United States, and uses U.S. conventions if no <code class="filename">locales.conf</code> is present. The <code class="filename">locales.conf</code> provided with the installation also reflects these conventions.</p><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Important"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Important]" src="../images/important.gif" /></td><th align="left">Important</th></tr><tr><td align="left" valign="top"><p><code class="filename">locales.conf</code> will probably be dropped from <span class="productname">FreeTDS</span> one day. Its only real purpose now is to control the format of date strings. The Right Way™ to deduce the appropriate default date format is from the application's locale settings, while allowing an override in <code class="filename">freetds.conf</code>. That's the direction we're headed.</p><p>If your purpose is to affect the client charset description, use <code class="filename">freetds.conf</code> instead.</p></td></tr></table></div><p>Information on locales and locale strings is easily (even too easily!) found on the Internet, or see <span class="command"><strong>man locale</strong></span> for your system. <span class="productname">FreeTDS</span> will examine its environment for a <code class="literal">LOCALE</code> string. If it finds one, it will look it up in <code class="filename">locales.conf</code> to find your preferred settings. If it fails to find one, it will use its defaults.</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="localeslocation"></a>Where it goes</h3></div></div></div><p>Like <code class="filename">freetds.conf</code>, the location of <code class="filename">locales.conf</code> is determined by the value of <code class="option">--sysconfdir</code> to <span class="command"><strong>configure</strong></span>. The default is <code class="literal">PREFIX/etc</code>.</p></div><div class="sect2"><div class="titlepage"><div><div><h3 class="title"><a id="localesformat"></a>What it looks like</h3></div></div></div><p>The format of <code class="filename">locales.conf</code> is similar to that of <code class="filename">freetds.conf</code>. There is a <code class="literal">[default]</code> section, and a section for each locale. <code class="filename">locales.conf</code> controls three settings </p><div class="variablelist"><a id="tab.locales.conf"></a><dl class="variablelist"><dt><span class="term"><code class="literal">date format</code></span></dt><dd><p>This entry will be passed (almost) literally to <code class="function">strftime(3)</code> to convert dates to strings.</p><p>For the most part, see you system documentation for <code class="function">strftime(3)</code> (<span class="command"><strong>man 3 strftime</strong></span>). You will see there though that <code class="function">strftime(3)</code> has no provision for milliseconds. The <code class="filename">locales.conf</code> format string uses <code class="literal">%z</code> for milliseconds. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.gif" /></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p>If your system's <code class="function">strftime(3)</code> does employ <code class="literal">%z</code> for its own use, it will not be given that chance by <span class="productname">FreeTDS</span>. <span class="productname">FreeTDS</span> will consume the <code class="literal">%z</code> for its milliseconds needs, and will not pass it on to <code class="function">strftime(3)</code>.</p></td></tr></table></div></dd><dt><span class="term"><code class="literal">language</code></span></dt><dd><p>The language that will be used for error/status messages from the server. A <span class="productname">SQL Server</span> client can specify a language for such messages at login time. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><table border="0" summary="Note"><tr><td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../images/note.gif" /></td><th align="left">Note</th></tr><tr><td align="left" valign="top"><p><span class="productname">FreeTDS</span> issues a few messages of its own. Messages from the server are called <span class="quote">“<span class="quote">messages</span>”</span>; those from the client library (i.e., from <span class="productname">FreeTDS</span>) are called <span class="quote">“<span class="quote">error messages</span>”</span>. <span class="productname">FreeTDS</span>-issued messages are not affected by <code class="filename">locales.conf</code>.</p></td></tr></table></div></dd><dt><span class="term"><code class="literal">charset</code></span></dt><dd><p>Indicates to the server what character set should be used for communicating with the client.</p></dd></dl></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="freetdsconf.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="install.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="envvar.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">The <code class="filename">freetds.conf</code> file </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Environment variables</td></tr></table></div></body></html>