Converting characters

I’ve often had issues with character sets getting muddled up.. generally from my clients pasting ISO-8859-1 special chars into my sites that are UTF-8. Today I discovered the super-handy iconv() function that’ll convert character sets.. in this case I needed to drop down to ascii for generating pdfs with dompdf:

$output = iconv('UTF-8', 'ASCII//TRANSLIT', $string);

Pretty handy!

Leave a Reply

Your email address will not be published. Required fields are marked *