Page 1 of 1
From Wordpress to Serendipity
Posted: Sat Oct 07, 2006 10:36 pm
by crilla
I have read the install howto and the installation was smooth, But:
Importing from Wordpress must be done in UTF-8 because its written i swedish. Then i got problems with ? instead of the swedish åäö so i send a mail to my hosting service and the told me they are not supporting UTF-8 and bla bla. Can't change it. Thats a fact...
Is it possible to do a dirty hack in some of the Serendipity PHP files? Just Måndag instead of M?ndag? Its only the week days name that got the annoying error.
I good blog engine should be hackable

Posted: Sun Oct 08, 2006 3:45 am
by carl_galloway
the quick and dirty way would be to open the lang file (folder named lang) for your locale, then where every special character is causing problems, simply change the character from the actual character to the ascii equivalent. Its messy, and not recommended because the lang files are supposed to work but if your host...
Maybe you should change host, I mean not supporting utf-8 seems so 20th century

I doesnt help
Posted: Sun Oct 08, 2006 4:32 am
by crilla
I doesnt seem to help because the weekday dont seems to be in the lang file? Its only the week days that's dont work. I can see it in the calendar and the post header. Everthing else looks nice.
The configuration must be somewhere else? Perhaps in the database.
My hosting is one of the largest and i dont seem to be able change their mind. No curl, no imagemagic, no UTF-8. But cheap...

Posted: Sun Oct 08, 2006 8:01 pm
by carl_galloway
ah. Looking through the s9y files, the calendar is created in functions_calendar.inc.php (include folder) but rendered in your site using the file plugin_calendar.tpl (template folder)
Unfortunately, the weekday name is generated by the php date routine and not by Serendipity so if you wanted to get down and dirty you would most likely have to add an {if} statement to the plugin_calendar.tpl file that translates the standard utf-8 version to your own ascii version.
Thanks...
Posted: Sun Oct 08, 2006 8:29 pm
by crilla
Thanks for the help but i guess i have to live with the problem. The character is okey if i dont use the UTF-8 in serendipity administration, but then the import from Wordpress generates "hieroglyphs" instead ?!?
Perhaps RSS import? I dont know, but thanks for the help anyway...
Re: Thanks...
Posted: Mon Oct 09, 2006 12:32 pm
by garvinhicking
Hi!
The "bad" characters in the date happen, because Serendipity makes use of the locale system of your webserver. When you use UTF-8, serendipity tries to use the locale that has UTF-8 characters.
The best thing for you would be to stick with UTF-8 setup, but edit your language file lang/UTF-8/serendipity_lang_se.inc.php. There look at the first lines and change the "LOCALE" row so that you remove "UTF8" from the locale key names.
Then the dates will be printed with ISO-characters as usual. You will then need to edit the file include/functions.inc.php. There you need to set the $is_win_utf variable to true in the function serendipity_strftime.
Modify this:
Code: Select all
static $is_win_utf = null;
if ($is_win_utf === null) {
// Windows does not have UTF-8 locales.
$is_win_utf = (LANG_CHARSET == 'UTF-8' && strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? true : false);
}
to this:
HTH,
Garvin
Yeeaah!
Posted: Tue Oct 10, 2006 6:19 pm
by crilla
Yeeaah! Great! Thanks!
I just need to change the funktions file. My lang file didnt include any utf8 lines. Now things beginning to look nice again
http://www.befrielse.org/serendipity/