<?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>My Own Percept&#187; c#</title>
	<atom:link href="http://myownpercept.com/tag/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://myownpercept.com</link>
	<description>&#34;Only in quiet waters things mirror themselves undistorted. Only in a quiet mind is adequate perception of the world.&#34;~Hans Margolius</description>
	<lastBuildDate>Fri, 30 Mar 2012 16:42:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Replacing special Chars in a String c#</title>
		<link>http://myownpercept.com/2009/06/replacing-special-chars-string-csharp/</link>
		<comments>http://myownpercept.com/2009/06/replacing-special-chars-string-csharp/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 16:30:40 +0000</pubDate>
		<dc:creator>Marouan OMEZZINE</dc:creator>
				<category><![CDATA[snippet]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://www.myownpercept.com/?p=221</guid>
		<description><![CDATA[<p>I have been working on a c# french desktop application. Unfortunately iTextSharp, which is an open source java library for PDF generation written entirely in C# for the .NET platform, do not allow to print special chars (é, è, ç &#8230;etc.) properly. Happily, I found this very useful piece of code in the Internet and [...]</p>
 ]]></description>
			<content:encoded><![CDATA[<p>I have been working on a <strong>c#</strong> french desktop application. Unfortunately <a href="http://itextsharp.sourceforge.net/">iTextSharp</a>, which is an open source java library for PDF generation written entirely in C# for the .NET platform, do not allow to print special chars (é, è, ç &#8230;etc.) properly. </p>
<p>Happily, I found this very useful piece of code in the Internet and I want to share it with you:</p>
<p></p><pre class="crayon-plain-tag">/// &lt;summary&gt;
/// Delete all Accents
/// &lt;/summary&gt;
/// &lt;param name=&quot;txt&quot;&gt;Source String with accents and special Char&lt;/param&gt;
/// &lt;returns&gt;Source String without accents and special Char&lt;/returns&gt;
        private static string DeleteAccentAndSpecialsChar(string OriginalText)
        {
            string strTemp = OriginalText;
            // Regex creation
            Regex regA = new Regex(&quot;[&atilde;|&agrave;|&acirc;|&auml;|&aacute;|&aring;]&quot;);
            Regex regAA = new Regex(&quot;[&Atilde;|&Agrave;|&Acirc;|&Auml;|&Aacute;|&Aring;]&quot;);
            Regex regE = new Regex(&quot;[&eacute;|&egrave;|&ecirc;|&euml;]&quot;);
            Regex regEE = new Regex(&quot;[&Eacute;|&Egrave;|&Ecirc;|&Euml;]&quot;);
            Regex regI = new Regex(&quot;[&iacute;|&igrave;|&icirc;|&iuml;]&quot;);
            Regex regII = new Regex(&quot;[&Iacute;|&Igrave;|&Icirc;|&Iuml;]&quot;);
            Regex regO = new Regex(&quot;[&otilde;|&ograve;|&oacute;|&ocirc;|&ouml;]&quot;);
            Regex regOO = new Regex(&quot;[&Otilde;|&Oacute;|&Ograve;|&Ocirc;|&Ouml;]&quot;);
            Regex regU = new Regex(&quot;[&ugrave;|&uacute;|&ucirc;|&uuml;|&micro;]&quot;);
            Regex regUU = new Regex(&quot;[&Uuml;|&Uacute;|&Ugrave;|&Ucirc;]&quot;);
            Regex regY = new Regex(&quot;[&yacute;|&yuml;]&quot;);
            Regex regYY = new Regex(&quot;[&Yacute;]&quot;);
            Regex regAE = new Regex(&quot;[&aelig;]&quot;);
            Regex regAEAE = new Regex(&quot;[&AElig;]&quot;);
            Regex regOE = new Regex(&quot;[&oelig;]&quot;);
            Regex regOEOE = new Regex(&quot;[&OElig;]&quot;);
            Regex regC = new Regex(&quot;[&ccedil;]&quot;);
            Regex regCC = new Regex(&quot;[&Ccedil;]&quot;);
            Regex regDD = new Regex(&quot;[&ETH;]&quot;);
            Regex regN = new Regex(&quot;[&ntilde;]&quot;);
            Regex regNN = new Regex(&quot;[&Ntilde;]&quot;);
            Regex regS = new Regex(&quot;[&scaron;]&quot;);
            Regex regSS = new Regex(&quot;[&Scaron;]&quot;);
            strTemp = regA.Replace(strTemp, &quot;a&quot;);
            strTemp = regAA.Replace(strTemp, &quot;A&quot;);
            strTemp = regE.Replace(strTemp, &quot;e&quot;);
            strTemp = regEE.Replace(strTemp, &quot;E&quot;);
            strTemp = regI.Replace(strTemp, &quot;i&quot;);
            strTemp = regII.Replace(strTemp, &quot;I&quot;);
            strTemp = regO.Replace(strTemp, &quot;o&quot;);
            strTemp = regOO.Replace(strTemp, &quot;O&quot;);
            strTemp = regU.Replace(strTemp, &quot;u&quot;);
            strTemp = regUU.Replace(strTemp, &quot;U&quot;);
            strTemp = regY.Replace(strTemp, &quot;y&quot;);
            strTemp = regYY.Replace(strTemp, &quot;Y&quot;);
            strTemp = regAE.Replace(strTemp, &quot;ae&quot;);
            strTemp = regAEAE.Replace(strTemp, &quot;AE&quot;);
            strTemp = regOE.Replace(strTemp, &quot;oe&quot;);
            strTemp = regOEOE.Replace(strTemp, &quot;OE&quot;);
            strTemp = regC.Replace(strTemp, &quot;c&quot;);
            strTemp = regCC.Replace(strTemp, &quot;C&quot;);
            strTemp = regDD.Replace(strTemp, &quot;D&quot;);
            strTemp = regN.Replace(strTemp, &quot;n&quot;);
            strTemp = regNN.Replace(strTemp, &quot;N&quot;);
            strTemp = regS.Replace(strTemp, &quot;s&quot;);
            strTemp = regSS.Replace(strTemp, &quot;S&quot;);
            return strTemp;

            return strTemp;
        }</pre><p></p>
<p><em>Source : <a href="http://www.codyx.org/snippet_modifie-caracteres-speciaux_154.aspx">http://www.codyx.org/snippet_modifie-caracteres-speciaux_154.aspx</a></em><br />
ps : Don&#8217;t forget to import <em>RegularExpressions </em>in your namespace.</p><pre class="crayon-plain-tag">using System.Text.RegularExpressions;</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>http://myownpercept.com/2009/06/replacing-special-chars-string-csharp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

