iconv returns blank string, not false

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



why is this iconv function not working for me?  
i am converting $search to euc-kr charset.....
my conversion code is not working.

background and motivation
--------------------
i 	have to mimic a accept-charset on a form to fake a get request by
disguising it as a hyperlink.  (my firefox refuses me tosend a remote
post request from a win_open() [ al a javascript] function.

the accept-charset value is 'euc-kr'.

i threw in extra iconv_set_encoding to eliminate some problem there, but
still no progress... :(

code
----------
$xab = 1;
$str_out =  mb_detect_encoding($search);
$converted_search="ax";
iconv_set_encoding("output_encoding", "EUC-KR");
iconv_set_encoding("input_encoding", $str_out);
if ($xab) echo " mb_detect_encoding***" . $str_out ."***search***
$search***<br>";
if ( function_exists('iconv') )   {
    if ($str_out != 'euc-kr') {
        if ($xab) var_dump( iconv_get_encoding('all'));
        if ($xab) echo "iconv: \$converted_search***$converted_search***
<br>";
        $converted_search = iconv($str_out,"EUC-KR",$search);
        if ($xab) echo "iconv: \$converted_search***$converted_search***
<br>";
    }
}


output (checks that search is proper and outputs "iconv_detect_encoding"
and checks return from iconv function call)
-----
mb_detect_encoding***UTF-8***search***꺼다***
array(3) { ["input_encoding"]=> string(5) "UTF-8" ["output_encoding"]=>
string(6) "EUC-KR" ["internal_encoding"]=> string(10) "ISO-8859-1" }
iconv: $converted_search***ax*** 
iconv: $converted_search******

many blessings to all.
merry chirstmas.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux