<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Sample C# code to convert Hexadecimal String to ASCII</title>
	<atom:link href="http://pcheruku.wordpress.com/2008/09/25/sample-c-code-to-convert-hexadecimal-string-to-ascii/feed/" rel="self" type="application/rss+xml" />
	<link>http://pcheruku.wordpress.com/2008/09/25/sample-c-code-to-convert-hexadecimal-string-to-ascii/</link>
	<description>for everyone</description>
	<lastBuildDate>Wed, 01 Jul 2009 20:03:55 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Geek</title>
		<link>http://pcheruku.wordpress.com/2008/09/25/sample-c-code-to-convert-hexadecimal-string-to-ascii/#comment-173</link>
		<dc:creator>Geek</dc:creator>
		<pubDate>Wed, 01 Jul 2009 20:03:55 +0000</pubDate>
		<guid isPermaLink="false">http://pcheruku.wordpress.com/?p=330#comment-173</guid>
		<description>This might cause problems if quotes itself (or some other special characters) are part of the string. A better way would be using bytes array and then using encoding to get string. For example i ran into an issue where this was the ascii result &quot;I”ÊôL&quot; but the hex value of 4994CAF44C would not translate into it using stringbuilder. Here&#039;s my solution. Please let me know what you think. thx

   private static string HexString2Ascii(string hexString)
        {
            byte[] tmp;
            int j = 0;
            tmp = new byte[(hexString.Length)/2];
            for (int i = 0; i &lt;= hexString.Length - 2; i += 2)
            {                
                tmp[j] =(byte)Convert.ToChar(Int32.Parse(hexString.Substring(i, 2), System.Globalization.NumberStyles.HexNumber));

                j++;
            }
            return Encoding.GetEncoding(1252).GetString(tmp);
        }</description>
		<content:encoded><![CDATA[<p>This might cause problems if quotes itself (or some other special characters) are part of the string. A better way would be using bytes array and then using encoding to get string. For example i ran into an issue where this was the ascii result &#8220;I”ÊôL&#8221; but the hex value of 4994CAF44C would not translate into it using stringbuilder. Here&#8217;s my solution. Please let me know what you think. thx</p>
<p>   private static string HexString2Ascii(string hexString)<br />
        {<br />
            byte[] tmp;<br />
            int j = 0;<br />
            tmp = new byte[(hexString.Length)/2];<br />
            for (int i = 0; i &lt;= hexString.Length &#8211; 2; i += 2)<br />
            {<br />
                tmp[j] =(byte)Convert.ToChar(Int32.Parse(hexString.Substring(i, 2), System.Globalization.NumberStyles.HexNumber));</p>
<p>                j++;<br />
            }<br />
            return Encoding.GetEncoding(1252).GetString(tmp);<br />
        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sam</title>
		<link>http://pcheruku.wordpress.com/2008/09/25/sample-c-code-to-convert-hexadecimal-string-to-ascii/#comment-172</link>
		<dc:creator>sam</dc:creator>
		<pubDate>Wed, 17 Jun 2009 20:36:38 +0000</pubDate>
		<guid isPermaLink="false">http://pcheruku.wordpress.com/?p=330#comment-172</guid>
		<description>thanks a lot</description>
		<content:encoded><![CDATA[<p>thanks a lot</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Crystel</title>
		<link>http://pcheruku.wordpress.com/2008/09/25/sample-c-code-to-convert-hexadecimal-string-to-ascii/#comment-149</link>
		<dc:creator>Crystel</dc:creator>
		<pubDate>Wed, 28 Jan 2009 14:06:29 +0000</pubDate>
		<guid isPermaLink="false">http://pcheruku.wordpress.com/?p=330#comment-149</guid>
		<description>Hi,i need to convert the data &quot;7820 6a75 6d70 6564 206f 7665 7220&quot; into ascii using c# ,how is it done, can anyone help,please.</description>
		<content:encoded><![CDATA[<p>Hi,i need to convert the data &#8220;7820 6a75 6d70 6564 206f 7665 7220&#8243; into ascii using c# ,how is it done, can anyone help,please.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kenny</title>
		<link>http://pcheruku.wordpress.com/2008/09/25/sample-c-code-to-convert-hexadecimal-string-to-ascii/#comment-128</link>
		<dc:creator>kenny</dc:creator>
		<pubDate>Tue, 21 Oct 2008 09:03:28 +0000</pubDate>
		<guid isPermaLink="false">http://pcheruku.wordpress.com/?p=330#comment-128</guid>
		<description>hey it&#039;s okay. the problem doesn&#039;t lie with the stringbuilder. thanks for the code! :)</description>
		<content:encoded><![CDATA[<p>hey it&#8217;s okay. the problem doesn&#8217;t lie with the stringbuilder. thanks for the code! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kenny</title>
		<link>http://pcheruku.wordpress.com/2008/09/25/sample-c-code-to-convert-hexadecimal-string-to-ascii/#comment-127</link>
		<dc:creator>kenny</dc:creator>
		<pubDate>Tue, 21 Oct 2008 04:00:13 +0000</pubDate>
		<guid isPermaLink="false">http://pcheruku.wordpress.com/?p=330#comment-127</guid>
		<description>hi, would there be a better alternative other than stringbuilder? cos my hex string is very very very long. it would be best if it can build an unlimited amount.</description>
		<content:encoded><![CDATA[<p>hi, would there be a better alternative other than stringbuilder? cos my hex string is very very very long. it would be best if it can build an unlimited amount.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Praveen</title>
		<link>http://pcheruku.wordpress.com/2008/09/25/sample-c-code-to-convert-hexadecimal-string-to-ascii/#comment-119</link>
		<dc:creator>Praveen</dc:creator>
		<pubDate>Mon, 06 Oct 2008 18:06:10 +0000</pubDate>
		<guid isPermaLink="false">http://pcheruku.wordpress.com/?p=330#comment-119</guid>
		<description>Your Welcome!</description>
		<content:encoded><![CDATA[<p>Your Welcome!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diego</title>
		<link>http://pcheruku.wordpress.com/2008/09/25/sample-c-code-to-convert-hexadecimal-string-to-ascii/#comment-118</link>
		<dc:creator>Diego</dc:creator>
		<pubDate>Mon, 06 Oct 2008 17:49:10 +0000</pubDate>
		<guid isPermaLink="false">http://pcheruku.wordpress.com/?p=330#comment-118</guid>
		<description>Muito obrigado!</description>
		<content:encoded><![CDATA[<p>Muito obrigado!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
