Support » Fixing WordPress » How does WP remove accents from Polish characters?

  • Resolved Trahald


    What function does WordPress use to convert Polish characters to English equivalents? For instance ‘ą’ to ‘a’.

    List of Polish characters:
    ł ą ż ę ć ń ś ź
    Ł Ą Ż Ę Ć Ń Ś Ź

    When I post these characters in a post title their accents are removed properly by WordPress for the post URL (ł becomes l and so on). But if I manually include wp-includes/formatting.php in a new script outside WordPress, the remove_accents() function leaves these characters as-is, and the sanitize_title_with_dashes() function simply deletes these characters.

    I’d like to convert these characters in a separate plugin. Does anyone know what function is WordPress using for these characters?

Viewing 1 replies (of 1 total)
  • I got this working, both remove_accents() and sanitize_title_with_dashes() work. All I had to do was set header(‘Content-Type: text/html; charset=utf-8’); in the display script.

    Just to note, the difference between remove_accents() and sanitize_title_with_dashes() [other than adding the dashes of course] is that the latter sanitizes out all character other than %, alphanumeric, _ and -, and it also trims whitespace.

Viewing 1 replies (of 1 total)
  • The topic ‘How does WP remove accents from Polish characters?’ is closed to new replies.