• Resolved Trahald

    (@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)
  • Thread Starter Trahald

    (@trahald)

    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.