<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Ruby, part2</title>
	<atom:link href="http://blogs.gnome.org/sudaltsov/2007/09/22/ruby-part2/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/sudaltsov/2007/09/22/ruby-part2/</link>
	<description>Just another GNOME Blogs weblog</description>
	<lastBuildDate>Mon, 31 Oct 2011 08:01:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Sergey Udaltsov</title>
		<link>http://blogs.gnome.org/sudaltsov/2007/09/22/ruby-part2/comment-page-1/#comment-125</link>
		<dc:creator>Sergey Udaltsov</dc:creator>
		<pubDate>Sat, 29 Sep 2007 13:50:33 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/sudaltsov/2007/09/22/ruby-part2/#comment-125</guid>
		<description>jose,

Thanks for the snippet and the links! Very useful!</description>
		<content:encoded><![CDATA[<p>jose,</p>
<p>Thanks for the snippet and the links! Very useful!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jose akallo</title>
		<link>http://blogs.gnome.org/sudaltsov/2007/09/22/ruby-part2/comment-page-1/#comment-124</link>
		<dc:creator>jose akallo</dc:creator>
		<pubDate>Sat, 29 Sep 2007 13:14:41 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/sudaltsov/2007/09/22/ruby-part2/#comment-124</guid>
		<description>There is a u16tou8 method in rbuconv, http://www.yoshidam.net/Ruby.html that goes like this:

&lt;code&gt;
  def u16tou8(str)
    ret = combineSurrogatePair(str.unpack(&#039;v*&#039;)).pack(&#039;U*&#039;)
    ret.taint if str.tainted?
    ret
  end
&lt;/code&gt;

Would this do what you want?

Some useful utf8 methods btw can be found at http://snippets.dzone.com/posts/show/4527

Cheers,
jose</description>
		<content:encoded><![CDATA[<p>There is a u16tou8 method in rbuconv, <a href="http://www.yoshidam.net/Ruby.html" rel="nofollow">http://www.yoshidam.net/Ruby.html</a> that goes like this:</p>
<p><code><br />
  def u16tou8(str)<br />
    ret = combineSurrogatePair(str.unpack('v*')).pack('U*')<br />
    ret.taint if str.tainted?<br />
    ret<br />
  end<br />
</code></p>
<p>Would this do what you want?</p>
<p>Some useful utf8 methods btw can be found at <a href="http://snippets.dzone.com/posts/show/4527" rel="nofollow">http://snippets.dzone.com/posts/show/4527</a></p>
<p>Cheers,<br />
jose</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sergey Udaltsov</title>
		<link>http://blogs.gnome.org/sudaltsov/2007/09/22/ruby-part2/comment-page-1/#comment-117</link>
		<dc:creator>Sergey Udaltsov</dc:creator>
		<pubDate>Sat, 22 Sep 2007 22:22:24 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/sudaltsov/2007/09/22/ruby-part2/#comment-117</guid>
		<description>Rutger, I mean String.unpack function (modeled after the perl&#039;s one AFAIK). It has syntax for UTF-8 but not for UTF-16. I know about iconv (and uconv) but that&#039;s not exactly same thing...</description>
		<content:encoded><![CDATA[<p>Rutger, I mean String.unpack function (modeled after the perl&#8217;s one AFAIK). It has syntax for UTF-8 but not for UTF-16. I know about iconv (and uconv) but that&#8217;s not exactly same thing&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rutger Nijlunsing</title>
		<link>http://blogs.gnome.org/sudaltsov/2007/09/22/ruby-part2/comment-page-1/#comment-116</link>
		<dc:creator>Rutger Nijlunsing</dc:creator>
		<pubDate>Sat, 22 Sep 2007 16:12:36 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/sudaltsov/2007/09/22/ruby-part2/#comment-116</guid>
		<description>I don&#039;t know what you mean by &#039;unpacking&#039;, but for UTF16 I tend to use

require &#039;iconv&#039;

class Iconv
    def self.utf8_to_utf16(str); Iconv.iconv(&quot;UTF-16LE&quot;, &quot;UTF-8&quot;, str)[0]; end
    def self.utf16_to_utf8(str); Iconv.iconv(&quot;UTF-8&quot;, &quot;UTF-16LE&quot;, str)[0]; end
end

...to convert between utf8 and utf16.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t know what you mean by &#8216;unpacking&#8217;, but for UTF16 I tend to use</p>
<p>require &#8216;iconv&#8217;</p>
<p>class Iconv<br />
    def self.utf8_to_utf16(str); Iconv.iconv(&#8220;UTF-16LE&#8221;, &#8220;UTF-8&#8243;, str)[0]; end<br />
    def self.utf16_to_utf8(str); Iconv.iconv(&#8220;UTF-8&#8243;, &#8220;UTF-16LE&#8221;, str)[0]; end<br />
end</p>
<p>&#8230;to convert between utf8 and utf16.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Felipe Contreras</title>
		<link>http://blogs.gnome.org/sudaltsov/2007/09/22/ruby-part2/comment-page-1/#comment-115</link>
		<dc:creator>Felipe Contreras</dc:creator>
		<pubDate>Sat, 22 Sep 2007 13:41:25 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.gnome.org/sudaltsov/2007/09/22/ruby-part2/#comment-115</guid>
		<description>Fortunately the Ruby community is very friendly and would probably welcome your rant. I recommend the Ruby Talk mailing list.

http://www.ruby-lang.org/en/community/

What I could find is that Unicode strings are planned for Ruby 2.0 and:

http://rubyforge.org/projects/icu4r/
http://raa.ruby-lang.org/project/uconv/
http://www.geocities.jp/kosako3/oniguruma/</description>
		<content:encoded><![CDATA[<p>Fortunately the Ruby community is very friendly and would probably welcome your rant. I recommend the Ruby Talk mailing list.</p>
<p><a href="http://www.ruby-lang.org/en/community/" rel="nofollow">http://www.ruby-lang.org/en/community/</a></p>
<p>What I could find is that Unicode strings are planned for Ruby 2.0 and:</p>
<p><a href="http://rubyforge.org/projects/icu4r/" rel="nofollow">http://rubyforge.org/projects/icu4r/</a><br />
<a href="http://raa.ruby-lang.org/project/uconv/" rel="nofollow">http://raa.ruby-lang.org/project/uconv/</a><br />
<a href="http://www.geocities.jp/kosako3/oniguruma/" rel="nofollow">http://www.geocities.jp/kosako3/oniguruma/</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- This Quick Cache file was built for (  blogs.gnome.org/sudaltsov/2007/09/22/ruby-part2/feed/ ) in 1.17818 seconds, on Feb 10th, 2012 at 2:46 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 10th, 2012 at 3:46 pm UTC -->
