php 4 data encoding
<p>I have legacy system, trying to get info from new database.
PHP 4.4.4
Apache 1.3.37</p>

<p>Both following code lines returns same "UTF-8"</p>

<pre><code>echo mb_detect_encoding("ąčę","auto");
echo mb_detect_encoding("$test","auto");
</code></pre>

<p>$test is data taken from database containing same characters.
Page charset is set to windows-1257.</p>

<pre><code>echo "ąčę";
echo $test;
</code></pre>

<p>Code outputs first string correctly, second with question marks.
When i change page encoding in browser to UTF-8 first line is scrambled, second shows correctly.</p>

<pre><code>echo mb_convert_encoding($test,"windows-1257","UTF-8");
</code></pre>

<p>Returns error Unknown encoding "windows-1257". </p>

<p>How should i work this out for data from database to be show correctly?</p>
