<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>locale | LogikDevelopment</title>
	<atom:link href="https://www.logikdev.com/tag/locale/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.logikdev.com</link>
	<description>&#34;Il n&#039;y a pas de problème, il n&#039;y a que des solutions. L&#039;esprit de l&#039;homme invente ensuite le problème.&#34; André Gide</description>
	<lastBuildDate>Tue, 25 Apr 2017 13:57:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>
	<item>
		<title>Relation between TortoiseSVN and locale</title>
		<link>https://www.logikdev.com/2010/08/15/relation-between-tortoisesvn-and-locale/</link>
					<comments>https://www.logikdev.com/2010/08/15/relation-between-tortoisesvn-and-locale/#respond</comments>
		
		<dc:creator><![CDATA[smoreau]]></dc:creator>
		<pubDate>Sun, 15 Aug 2010 20:23:25 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[locale]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[TortoiseSVN]]></category>
		<guid isPermaLink="false">https://www.logikdev.com/?p=684</guid>

					<description><![CDATA[<p>The other day, I got stuck on a problem with TortoiseSVN for about half a day! 😯 Yes, I know, it is a pretty long time to get a simple subversion client working&#8230; The error I was continuously getting was: Nothing else! Nothing in the log files on both the client and the server. 🙁 [&#8230;]</p>
<p>The post <a href="https://www.logikdev.com/2010/08/15/relation-between-tortoisesvn-and-locale/">Relation between TortoiseSVN and locale</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>The other day, I got stuck on a problem with TortoiseSVN for about half a day! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f62f.png" alt="😯" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br />
Yes, I know, it is a pretty long time to get a simple subversion client working&#8230;</p>
<p>The error I was continuously getting was:</p>
<pre class="brush: plain; light: true; title: ; notranslate">
Network connection closed unexpectedly
</pre>
<p>Nothing else! Nothing in the log files on both the client and the server. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f641.png" alt="🙁" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br />
The funny thing is that it was working perfectly fine using a command line client or even <a href="http://www.eclipse.org/subversive/">Eclipse Subversive</a>.</p>
<p>After a (too) long time of investigation, I noticed that I was getting the following warnings when I was running the following command line directly on the server:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
$ svn list svn+ssh://smoreau@localhost/data/svn/
svn: warning: cannot set LC_CTYPE locale
svn: warning: environment variable LANG is en_US.UTF-8
svn: warning: please check that your locale name is correct
smoreau@localhost's password:
svnserve: warning: cannot set LC_CTYPE locale
svnserve: warning: environment variable LANG is en_US.UTF-8
svnserve: warning: please check that your locale name is correct
branches/
tags/
trunk/
</pre>
<p>Actually, any <code>svn</code> command was triggering the warning messages:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
$ svn info
svn: warning: cannot set LC_CTYPE locale
svn: warning: environment variable LANG is en_US.UTF-8
svn: warning: please check that your locale name is correct
</pre>
<p>Could it possibly be related with my TortoiseSVN problem?<br />
Because I didn&#8217;t have any other idea, I decided to give it a go. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>It appears that these warning messages came from a configuration problem around the locale package on the server. Indeed, look what we get if we run the <code>locale</code> command:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
$ locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
POSIX
</pre>
<p>After some more investigation, it looks like this problem appeared when I upgraded the version of the locale package via <a href="http://en.wikipedia.org/wiki/Advanced_Packaging_Tool">APT</a>. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f615.png" alt="😕" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Once again, I asked my friend Google to help me out. It suggested me the following solutions:</p>
<ul>
<li>Run <code>locale-gen en_US.UTF-8</code> &#8211; <strong>Didn&#8217;t work</strong></li>
<li>Run <code>update-locale LANG=en_US.UTF-8</code> &#8211; <strong>Didn&#8217;t work</strong></li>
<li>Run <code>dpkg-reconfigure locales</code> &#8211; <strong>WORKED</strong> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /></li>
</ul>
<p>In conclusion, I wasn&#8217;t able to use TortoiseSVN because of a configuration problem on the locale package after an upgrade&#8230; Does it make sense? <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f644.png" alt="🙄" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p><p>The post <a href="https://www.logikdev.com/2010/08/15/relation-between-tortoisesvn-and-locale/">Relation between TortoiseSVN and locale</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.logikdev.com/2010/08/15/relation-between-tortoisesvn-and-locale/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Locale settings for your cron job</title>
		<link>https://www.logikdev.com/2010/02/02/locale-settings-for-your-cron-job/</link>
					<comments>https://www.logikdev.com/2010/02/02/locale-settings-for-your-cron-job/#comments</comments>
		
		<dc:creator><![CDATA[smoreau]]></dc:creator>
		<pubDate>Tue, 02 Feb 2010 22:55:35 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[locale]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[UTF-8]]></category>
		<guid isPermaLink="false">https://www.logikdev.com/?p=291</guid>

					<description><![CDATA[<p>Do you get special characters problem when executing your bash script from a cron job? And does the same script work fine when it is directly executed from the command line? If yes, continue reading this article! 😉 The reason of this characters problem is probably because of your locale settings. Indeed, If you try [&#8230;]</p>
<p>The post <a href="https://www.logikdev.com/2010/02/02/locale-settings-for-your-cron-job/">Locale settings for your cron job</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Do you get special characters problem when executing your bash script from a cron job?<br />
And does the same script work fine when it is directly executed from the command line?<br />
If yes, continue reading this article! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>The reason of this characters problem is probably because of your locale settings.<br />
Indeed, If you try to run the command <code>locale</code> from the command line and from a cron job, you may get different results such as:</p>
<table style="width: 100%; border:0px;">
<tbody>
<tr>
<td style="width:50%; border:0px;">From the command line</td>
<td style="width:50%; border:0px;">From a cron job</td>
</tr>
<tr>
<td style="border:0px;">
<pre class="brush: bash; light: true; title: ; notranslate">
LANG=en_US.UTF-8
LC_CTYPE=&quot;en_US.UTF-8&quot;
LC_NUMERIC=&quot;en_US.UTF-8&quot;
LC_TIME=&quot;en_US.UTF-8&quot;
LC_COLLATE=&quot;en_US.UTF-8&quot;
LC_MONETARY=&quot;en_US.UTF-8&quot;
LC_MESSAGES=&quot;en_US.UTF-8&quot;
LC_PAPER=&quot;en_US.UTF-8&quot;
LC_NAME=&quot;en_US.UTF-8&quot;
LC_ADDRESS=&quot;en_US.UTF-8&quot;
LC_TELEPHONE=&quot;en_US.UTF-8&quot;
LC_MEASUREMENT=&quot;en_US.UTF-8&quot;
LC_IDENTIFICATION=&quot;en_US.UTF-8&quot;
LC_ALL=
</pre>
</td>
<td style="border:0px;">
<pre class="brush: bash; light: true; title: ; notranslate">
LANG=
LC_CTYPE=&quot;POSIX&quot;
LC_NUMERIC=&quot;POSIX&quot;
LC_TIME=&quot;POSIX&quot;
LC_COLLATE=&quot;POSIX&quot;
LC_MONETARY=&quot;POSIX&quot;
LC_MESSAGES=&quot;POSIX&quot;
LC_PAPER=&quot;POSIX&quot;
LC_NAME=&quot;POSIX&quot;
LC_ADDRESS=&quot;POSIX&quot;
LC_TELEPHONE=&quot;POSIX&quot;
LC_MEASUREMENT=&quot;POSIX&quot;
LC_IDENTIFICATION=&quot;POSIX&quot;
LC_ALL=
</pre>
</td>
</tr>
</tbody>
</table>
<p>As you can see, the cron job is not using UTF-8. That must be the problem! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>So the question now is how to change the locale settings for the cron job?<br />
Some people say that you need to add the following environment variables to the crontab entry:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
SHELL=/bin/bash
LANG=en_US.UTF-8
LANGUAGE=en
LC_CTYPE=en_US.UTF-8
</pre>
<p>But this actually didn&#8217;t work for me. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f641.png" alt="🙁" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>What you can do instead is create (if not already present) the file <code>/etc/environment</code> and add the following line:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
LANG=en_US.UTF-8
</pre>
<p>The cron process will read this file when it starts, so you need to restart it in order to apply the change:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
service cron restart
</pre>
<p>Hope this will fix your characters problem. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p><p>The post <a href="https://www.logikdev.com/2010/02/02/locale-settings-for-your-cron-job/">Locale settings for your cron job</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.logikdev.com/2010/02/02/locale-settings-for-your-cron-job/feed/</wfw:commentRss>
			<slash:comments>18</slash:comments>
		
		
			</item>
	</channel>
</rss>
