<?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>tip &#8211; Luxing Huang</title>
	<atom:link href="https://luxing.im/tag/tip/feed/" rel="self" type="application/rss+xml" />
	<link>https://luxing.im</link>
	<description>Thoughs and things</description>
	<lastBuildDate>Fri, 28 Feb 2014 01:35:56 +0000</lastBuildDate>
	<language>en-CA</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
<site xmlns="com-wordpress:feed-additions:1">58771605</site>	<item>
		<title>Changing text encoding with Vim</title>
		<link>https://luxing.im/changing-text-encoding-with-vim/</link>
					<comments>https://luxing.im/changing-text-encoding-with-vim/#respond</comments>
		
		<dc:creator><![CDATA[Luxing Huang]]></dc:creator>
		<pubDate>Fri, 28 Feb 2014 01:33:24 +0000</pubDate>
				<category><![CDATA[Techie Stuff]]></category>
		<category><![CDATA[charset]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[iconv]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[vim]]></category>
		<guid isPermaLink="false">http://blog.luxing.im/?p=301</guid>

					<description><![CDATA[A lot of subtitles in Chinese language are encoded with GB2312 or sometimes Code Page 936 (CP936, aka gbk), are generated under Windows. This brings problems in many Linux based multimedia players. Converting using iconv is not that hard, since its command is simple to use: iconv -f gb2312 -t utf8 subtitle.srt -o converted.srt But &#8230; <p class="link-more"><a href="https://luxing.im/changing-text-encoding-with-vim/" class="more-link">Continue reading<span class="screen-reader-text"> "Changing text encoding with Vim"</span></a></p>]]></description>
										<content:encoded><![CDATA[<p>A lot of subtitles in Chinese language are encoded with GB2312 or sometimes Code Page 936 (CP936, aka gbk), are generated under Windows. This brings problems in many Linux based multimedia players.<br />
<span id="more-301"></span><br />
Converting using <strong>iconv</strong> is not that hard, since its command is simple to use:</p>
<pre>iconv -f gb2312 -t utf8 subtitle.srt -o converted.srt</pre>
<p>But in many cases, you will find error as such: </p>
<pre>iconv: illegal input sequence at position xxxx.</pre>
<p> To solve this, you can need to change the <strong>gb2312</strong> to some larger encoding set with the same catagory. For example, <strong>gbk</strong> is a super set of gb2312.</p>
<p>If you only know the file&#8217;s encoding but don&#8217;t know its super charset, you can always use vim to convert it.</p>
<pre>vim subtitle.srt</pre>
<p>Edit it with <em>++enc</em> option:</p>
<pre>:e ++enc=gb2312</pre>
<p>Save it with <em>++enc</em> option:</p>
<pre>:w ++enc=utf8 converted.srt</pre>
<p>Related documentation: <a href="http://vimdoc.sourceforge.net/htmldoc/usr_45.html#45.4" target="_blank">http://vimdoc.sourceforge.net/htmldoc/usr_45.html#45.4</a></p>
<p>All done!</p>
]]></content:encoded>
					
					<wfw:commentRss>https://luxing.im/changing-text-encoding-with-vim/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">301</post-id>	</item>
	</channel>
</rss>
