2

I've having trouble with accented characters now if i do utf8_decode() before echoing the title the problem is solved but instead of changing this all over my theme, can't I do this in one place that upgrade proof? I'm not really familiar with hooks but I think thats they way to do it, havent found out how to do it tho.

2
  • 3
    You should rather find out why UTF-8 does not work. That is the default encoding, and it should not be changed.
    – fuxia
    Commented Dec 11, 2012 at 9:02
  • Yea true but think is info comes from feed and the accented chars are not correctly in there its there uncoded, which means it gets loaded in uncoded so either I change the importer to decode before storing or i change the enchoing, decoding probly better. Which I just did
    – Bram
    Commented Dec 12, 2012 at 1:07

1 Answer 1

7

The filter for the_title functions is this one:

add_filter( 'the_title', 'f711_title_filter' );

function f711_title_filter( $title ) {

    return utf8_decode( $title );

}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.