• Hey chaps,
    Im experiencing a bug I believe.

    Im using Danish letters ??? ???.

    While entrys to the database table “wp_posts” column “post_title” and “post_content” are being written correctly with ???, the column “post_name” are not.. eg:

    post_title: “Vedt?gter”
    post_name: “vedt%c3%a6gter”

    This is a problem when I use wp_list_pages() and the permalink is the taking the “post_name” for href, this results in pages not found.

    A snippet of settings:

    wp-config.php
      define('DB_CHARSET', 'utf8');
      define('DB_COLLATE', '');
      define ('WPLANG', 'da_DK');

    Im running XAMPP on Vista 64 bit, and this is my development pc. I do however not consider it to be an OS or Apache issue.

    what to do, anyone with similar issues?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter maxemil

    (@maxemil)

    Im digging around, finding others with similar problem.
    Aparently post_name is also called SLUG…

    https://www.ads-software.com/support/topic/274134

    And *sigh* I realise its sanitize_title() that makes a laugh at our language.

    what to do.. what to do…

    Thread Starter maxemil

    (@maxemil)

    btw.. I dumped a code snippet from a plugin called “transliterado” into my functions.php … this dosent give me ??? letters, but atleast I dont get 404

    // ----   SLUG Permalink ???   --- //
    $translate_language = array(
    	'da' => array(
    		'NOMO' => 'Dansk, Norsk',
    		'da_aeoeaa' => '?, ?, ? → ae, oe, aa'
    	)
    );
    
    $translate_system = array();
    
    function sanitize_title_dk($title)
    {
    	global $translate_language, $translate_system;
    	if (!mb_check_encoding($title, 'ASCII'))
        {
          $title=utf8_decode($title);
          foreach (array_keys($translate_language) as $language)
            {
    		  $choise = 'da';
              switch ($choise)
              {
                case 'da':
        		$translate_system[] = array
                (
        		  "?"=>"ae","?"=>"oe","?"=>"aa","?"=>"ae","?"=>"oe","?"=>"aa"
        		);
              }
    		}
    	  foreach ($translate_system as $system)
          {
    	  	$title = strtr($title, $system);
    	  }
    	}
    	return $title;
    };
    add_filter('sanitize_title', 'sanitize_title_dk', 0);
    // ----   SLUG Permalink ???   END //

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Table: wp_posts, column post_name not unicode.’ is closed to new replies.