joshbrw
joshbrw

Reputation: 63

PHP - Converting "Mac Roman" to UTF-8

So, I seem to have gotten some Mac Roman characters in my database, and because of my Encryption setup I convert everything to UTF-8 upon record fetch.

The current code we're using to try and fix this is:

if ( ! mb_check_encoding( $strDecrypted, 'utf-8' ) )
{
    $strDecrypted = @iconv( mb_detect_encoding( $strDecrypted ), 'UTF-8//TRANSLIT', $strDecrypted );
}

But this is giving the following error:

Error Message: iconv(): Detected an illegal character in input string

Any help would be greatly appreciated!

Upvotes: 3

Views: 1639

Answers (0)

Related Questions