<?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>Guy Rutenberg &#187; Gettext</title>
	<atom:link href="http://www.guyrutenberg.com/tag/gettext/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.guyrutenberg.com</link>
	<description>Keeping track of what I do</description>
	<lastBuildDate>Wed, 16 Jun 2010 19:53:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Question Marks Instead of Non-ASCII Chars when using Gettext in PHP</title>
		<link>http://www.guyrutenberg.com/2008/11/24/question-marks-instead-of-non-ascii-chars-when-using-gettext-in-php/</link>
		<comments>http://www.guyrutenberg.com/2008/11/24/question-marks-instead-of-non-ascii-chars-when-using-gettext-in-php/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 14:54:02 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Gettext]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/?p=173</guid>
		<description><![CDATA[Yesterday I&#8217;ve ported a PHP website to use Gettext for localizations (l10n). After reading through the Gettext documentation and going through the documentation in the PHP site, I&#8217;ve manged to get everything working (almost). I had one problem, all the non-ASCII characters (accented Latin chars, Japanese and Chinese) where displayed as question marks (?) instead [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I&#8217;ve ported a PHP website to use <a href="http://www.gnu.org/software/gettext/">Gettext</a> for localizations (l10n). After reading through the Gettext documentation and going through the documentation in the <a href="http://www.php.net">PHP site</a>, I&#8217;ve manged to get everything working (almost). I had one problem, all the non-ASCII characters (accented Latin chars, Japanese and Chinese) where displayed as question marks (?) instead of the correct form. This happend despite me using UTF-8 encoded files.</p>
<p>While some people (e.g. <a href="http://www.php.net/manual/en/function.gettext.php#56314">this one</a>) suggested that it&#8217;s not possible to use non-ASCII characters when using a UTF-8 encoded message files, their is a soultion and it&#8217;s quiet simple one. All you have to do is to call <a href="http://www.php.net/manual/en/function.bind-textdomain-codeset.php"><code>bind_textdomain_codset</code></a> and pass it <code>UTF-8</code> as <code>charset</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2008/11/24/question-marks-instead-of-non-ascii-chars-when-using-gettext-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vim Macros for Wrapping Strings for Gettext</title>
		<link>http://www.guyrutenberg.com/2007/12/22/vim-macros-for-wrapping-strings-for-gettext/</link>
		<comments>http://www.guyrutenberg.com/2007/12/22/vim-macros-for-wrapping-strings-for-gettext/#comments</comments>
		<pubDate>Sat, 22 Dec 2007 10:52:20 +0000</pubDate>
		<dc:creator>Guy</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[Gettext]]></category>

		<guid isPermaLink="false">http://www.guyrutenberg.com/2007/12/22/vim-macros-for-wrapping-strings-for-gettext/</guid>
		<description><![CDATA[I&#8217;m working on a website and we decided to localize it using GNU gettext. Soon enough I found it tiring to wrap each string manually in _( and ) and also to do it in Smarty (using {t}string{/t}. So I decided that I need a macro that will let highlight the string that needs translation [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a website and we decided to localize it using <a href="http://www.gnu.org/software/gettext/">GNU gettext</a>. Soon enough I found it tiring to wrap each string manually in <code>_(</code> and <code>)</code> and also to do it in <a href="http://smarty.php.net">Smarty</a> (using <code>{t}string{/t}</code>. So I decided that I need a macro that will let highlight the string that needs translation and the macro will wrap for me. </p>
<p>I ended up writing two macros one for PHP files (but it&#8217;s also good for C/C++ etc.) and one for smarty.</p>

<div class="wp_syntax"><div class="code"><pre class="vim" style="font-family:monospace;"><span style="color: #000000;">:</span>vmap tg di_<span style="color: #000000;">&#40;</span><span style="color: #000000;">&lt;</span>ESC<span style="color: #000000;">&gt;</span>pa<span style="color: #000000;">&#41;</span><span style="color: #000000;">&lt;</span>ESC<span style="color: #000000;">&gt;</span>
<span style="color: #000000;">:</span>vmap ts di<span style="color: #000000;">&#123;</span>t<span style="color: #000000;">&#125;</span><span style="color: #000000;">&lt;</span>ESC<span style="color: #000000;">&gt;</span>pa<span style="color: #000000;">&#123;</span><span style="color: #000000;">/</span>t<span style="color: #000000;">&#125;</span><span style="color: #000000;">&lt;</span>ESC<span style="color: #000000;">&gt;</span></pre></div></div>

<p>To use these macros just highlight the string for translation in vim&#8217;s visual mode and press <code>tg</code> (or <code>ts</code>), and your string will be wrapped for translation. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.guyrutenberg.com/2007/12/22/vim-macros-for-wrapping-strings-for-gettext/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.409 seconds -->
