<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — mb_convert_encoding(): Illegal character encoding specified]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=4177&amp;type=atom" />
	<updated>2013-08-01T08:59:44Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=4177</id>
		<entry>
			<title type="html"><![CDATA[Re: mb_convert_encoding(): Illegal character encoding specified]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=17195#p17195" />
			<content type="html"><![CDATA[<p>Thanks for info and sorry for the delay.<br />Seems you have something broken in your lang/installed_languages.inc file. Check following things:<br />. $dflt_lang should be set to locale existing in one of $intalled_languages array (&#039;code&#039; element)<br />. every $installed_languages elements should have valid &#039;encoding&#039; value defined;<br />. records in 0_users table should have valid locale values in &#039;language&#039; field.</p><p>Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2013-08-01T08:59:44Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=17195#p17195</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: mb_convert_encoding(): Illegal character encoding specified]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=16952#p16952" />
			<content type="html"><![CDATA[<p>Sure. A few things to point out (more for my curiosity):<br /></p><ul><li><p>Isn&#039;t it too late at line 470? By this time empty parameter is already set in $this-&gt;SCRIPT_ENCODING, and it is $this-&gt;SCRIPT_ENCODING which is an empty parameter that is passed in $fromenc. As my analysis shows in original post, that initial value is wiped out around line 163 (obviously, my analysis may be wrong)</p></li><li><p>The file is huge (~27 thousand lines; 1MB). Hard for me to say what part is significant.</p></li><li><p>I don&#039;t see the way to upload a file here. But you can get it from <a href="http://www.rabinovich.org/.outgoing/bug4177.tar.gz">http://www.rabinovich.org/.outgoing/bug4177.tar.gz</a></p></li></ul>]]></content>
			<author>
				<name><![CDATA[virshu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18130</uri>
			</author>
			<updated>2013-07-02T21:26:04Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=16952#p16952</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: mb_convert_encoding(): Illegal character encoding specified]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=16951#p16951" />
			<content type="html"><![CDATA[<p>Interesting, but I to fix this issue we need to know where the empty parameter is passed from.<br />Could you include following code before line 470 in file JsHttpRequest.php:<br /></p><div class="codebox"><pre><code>        _vl(debug_backtrace());</code></pre></div><p>and cite the call stack stored in tmp/errors.log here?<br />Janusz</p>]]></content>
			<author>
				<name><![CDATA[itronics]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=89</uri>
			</author>
			<updated>2013-07-02T20:49:28Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=16951#p16951</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[mb_convert_encoding(): Illegal character encoding specified]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=16947#p16947" />
			<content type="html"><![CDATA[<p>I am getting the following error in the log in a few places:<br /> </p><div class="codebox"><pre><code>0:admin:JsHttpRequest.php:470: mb_convert_encoding(): Illegal character encoding specified</code></pre></div><p>Looks like the problem is in JsHttpRequest::setEncoding (line 163). When $enc being passed is empty, the default value of $this-&gt;SCRIPT_ENCODING (which is respectable &quot;windows-1251&quot;) is overwritten by an empty string.</p><p>And apparently <a href="http://www.php.net/manual/en/function.mb-convert-encoding.php">mb_convert_encoding</a> doesn&#039;t like an empty string. It&#039;s OK with missing third parameter, but not empty one.</p><p>When I wrapped &quot;parse an encoding&quot; in </p><div class="codebox"><pre><code>if (!empty($enc)) { ... }</code></pre></div><p> block, it seems to be working fine. Obviously, with English-only installation it is difficult to test how it behaves when encoding is actually set, but it works on my machine <img src="https://frontaccounting.com/punbb/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><p>The way this bug comes to the user - instead of a confirmation &quot;Company was updated successfully&quot; or similar, the user sees an orange warning sign</p>]]></content>
			<author>
				<name><![CDATA[virshu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=18130</uri>
			</author>
			<updated>2013-07-02T20:30:05Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=16947#p16947</id>
		</entry>
</feed>
