WatchMegoing
New Member
I read many posts on how to convert UTF-16 from/to UTF-8 but none advise what to do if I have both. I'm trying to insert an email body text that has UTF-16 and UTF-8 characters, using PHP, into SQL Server 2008 table column (UTF-8). I use \[code\]iconv()\[/code\] to convert from UTF-16 to UTF-8 but as I said it is not enough because it doesn't handle UTF-8:\[code\]$email->description_html = iconv("UTF-16","UTF-8//TRANSLIT",$that->getMessageText( $msgNo, 'HTML', $structure, $fullHeader,$clean_email)); $email->description = iconv("UTF-16","UTF-8//TRANSLIT",$that->getMessageText( $msgNo, 'PLAIN', $structure, $fullHeader,$clean_email));\[/code\]I tried this for both UTF-16 and UTF-8 but it doesn't work, gives a database error:\[code\]can't convert UTF-16 to UTF-8\[/code\]\[code\]$email->description_html= iconv('','UTF-8',$that->getMessageText( $msgNo, 'HTML', $structure, $fullHeader,$clean_email));\[/code\]I don't know what else to do , please help.