<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Single, double quotes and other special characters replacements]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6298&amp;type=atom" />
	<updated>2016-06-13T14:52:26Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=6298</id>
		<entry>
			<title type="html"><![CDATA[Re: Single, double quotes and other special characters replacements]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25624#p25624" />
			<content type="html"><![CDATA[<p>@apmuthu.<br />Please address this to Janusz. I am out of office until June 18.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2016-06-13T14:52:26Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25624#p25624</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Single, double quotes and other special characters replacements]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25623#p25623" />
			<content type="html"><![CDATA[<p>@joe: what parts need to make it to the core?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-06-13T14:12:23Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25623#p25623</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Single, double quotes and other special characters replacements]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25621#p25621" />
			<content type="html"><![CDATA[<p>Several steps:</p><p>1. Make sure the data in the database is inserted as utf8 so it&#039;ll be readable.<br />In includes/db/connect_db.inc:<br />In function set_global_connection() line #13 before returning $db:<br />+ mysql_set_charset(&quot;utf8&quot;, $db);</p><p>2. In order to get rid of all the HTML entities.<br />In reporting/includes/pdf_report.inc:</p><p>In function Text() line #732 at first line of the fubction:<br />+ $txt = html_entity_decode($txt);</p><p>In function function TextWrap() about line #743, after $str = strtr($str array(&quot;\r&quot;=&gt;&#039;&#039;));<br />+ $str = html_entity_decode($str); </p><p>In function End() about line #953:</p><p>In about line #953:<br />- $mail = new email(str_replace(&quot;,&quot;, &quot;&quot;, $this-&gt;company[&#039;coy_name&#039;]),<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;company[&#039;email&#039;]);</p><p>+ $mail = new email(str_replace(&quot;,&quot;, &quot;&quot;, html_entity_decode($this-&gt;company[&#039;coy_name&#039;])),<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $this-&gt;company[&#039;email&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />In about line #1036:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</p><p>- $sender = $this-&gt;user . &quot;\n&quot; . $this-&gt;company[&#039;coy_name&#039;] . &quot;\n&quot; . $this-&gt;company[&#039;postal_address&#039;] . &quot;\n&quot; . $this-&gt;company[&#039;email&#039;] . &quot;\n&quot; . $this-&gt;company[&#039;phone&#039;];</p><p>+ $sender = html_entity_decode($this-&gt;user) . &quot;\n&quot; . html_entity_decode($this-&gt;company[&#039;coy_name&#039;]) . &quot;\n&quot; . html_entity_decode($this-&gt;company[&#039;postal_address&#039;]) . &quot;\n&quot; . $this-&gt;company[&#039;email&#039;] . &quot;\n&quot; . html_entity_decode($this-&gt;company[&#039;phone&#039;]);</p><p>I hope it&#039;ll help.</p>]]></content>
			<author>
				<name><![CDATA[HagayM]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=22916</uri>
			</author>
			<updated>2016-06-12T18:00:03Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25621#p25621</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Single, double quotes and other special characters replacements]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25615#p25615" />
			<content type="html"><![CDATA[<p>Kindly provide code changes that worked.<br />It may be necessary to make the storage in the tables proper so that they do not get encoded multiple times like &amp; =&gt; &amp; amp; =&gt; &amp; amp;amp; etc.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-06-12T17:37:15Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25615#p25615</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Single, double quotes and other special characters replacements]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25605#p25605" />
			<content type="html"><![CDATA[<p>Thanks. <br />I solved it by alternating some code in pdf_report.inc, using&nbsp; html_entity_decode</p>]]></content>
			<author>
				<name><![CDATA[HagayM]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=22916</uri>
			</author>
			<updated>2016-06-06T06:41:03Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25605#p25605</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Single, double quotes and other special characters replacements]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25604#p25604" />
			<content type="html"><![CDATA[<p>There is some code in FA where Polish characters are spared. Checkout <strong><a href="https://github.com/FrontAccountingERP/FA/blob/master/includes/session.inc#L312">includes/session.inc</a></strong> lines 312-332 in FA 2.3:<br /></p><div class="codebox"><pre><code>function html_cleanup(&amp;$parms)
{
    foreach($parms as $name =&gt; $value) {
//        $value = @html_entity_decode($value, ENT_QUOTES, $_SESSION[&#039;language&#039;]-&gt;encoding);
        if (is_array($value))
            html_cleanup($parms[$name]);
        else
            $parms[$name] = @htmlspecialchars($value, ENT_QUOTES, $_SESSION[&#039;language&#039;]-&gt;encoding==&#039;iso-8859-2&#039; ? &#039;ISO-8859-1&#039; : $_SESSION[&#039;language&#039;]-&gt;encoding);
    }
    reset($parms); // needed for direct key() usage later throughout the sources
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-06-06T04:53:56Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25604#p25604</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Single, double quotes and other special characters replacements]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25602#p25602" />
			<content type="html"><![CDATA[<p>Yes I was afraid that this will be the sole solution.<br />Any available script to do the job?</p>]]></content>
			<author>
				<name><![CDATA[HagayM]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=22916</uri>
			</author>
			<updated>2016-06-04T09:05:16Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25602#p25602</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Single, double quotes and other special characters replacements]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25601#p25601" />
			<content type="html"><![CDATA[<p>A full list is <a href="http://www.danshort.com/HTMLentities/">here</a>.</p><p>A complete search and replace in the database is in order for such fields.<br />This is a known issue atleast in FA 2.3.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2016-06-04T06:00:48Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25601#p25601</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Single, double quotes and other special characters replacements]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=25600#p25600" />
			<content type="html"><![CDATA[<p>The way fa insets/updates data in the database is by replacing special characters with their HTML entities equivalents, for example:<br />&amp; will be converted to &amp;<br />&gt; will be converted to &gt;<br />&quot; will be converted to &quot;<br />The problem is that when the data containing these html entities is pulled from the database for reporting, the output pdf file is using these HTML entities and not the original characters. <br />Every single quote is becoming &#039; so for example the item description: a package of 100&#039; hose becomes: package of 100&#039; hose.<br />any ideas hoe this can be solved?<br />I&#039;m using version 2.3.25</p>]]></content>
			<author>
				<name><![CDATA[HagayM]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=22916</uri>
			</author>
			<updated>2016-06-03T21:37:13Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=25600#p25600</id>
		</entry>
</feed>
