Importing from wordpress breaks danish characters

0 views
Skip to first unread message

Thor Frølich

unread,
May 19, 2008, 2:42:05 PM5/19/08
to habari-users
I'm currently trying out Habari (got the latest from svn). When I
import my database from wordpress all the danish characters (æ, ø and
å) ends up as question marks. I'm not very familiar with encoding,
utf-8 and such esoteric tomfoolery.
Searching on this list turned up others with the same problem. Some
got around it by adding a line to classes/db.php. When I tried that, I
couldn't find the particular line after which you had to add the magic
line. Either I'm looking the wrong place or the code has changed since
that fix was suggested.

Any suggestions on how I can fix this or what I'm doing wrong?

Thanks,

Thor

msi

unread,
May 20, 2008, 3:27:01 AM5/20/08
to habari-users
I had the same problem with the german umlauts. Is your blog running
with UTF8? If you want to give it a try, open the
"wpimport.plugin.php" and add

$post->content = utf8_encode( $post->content );
$post->title = utf8_encode( $post->title );
for ( $tagI = 0; $tagI < count( $tags ); $tagI++ ) {
$tags[$tagI] = utf8_encode( $tags[$tagI] );
}

in front of

$post_array= $post->to_array();

and

$comment->content = utf8_encode( $comment->content );
$comment->name = utf8_encode( $comment->name );

in front of

$carray= $comment->to_array();


It's just a simple fix. I'm sure there will be a better way in a
future version of the plugin.

Thor Frølich

unread,
May 20, 2008, 3:51:31 AM5/20/08
to habari-users
That did the trick. You sir, are a genius.

Thanks so much,

Thor
Reply all
Reply to author
Forward
0 new messages