Problems with danish æ ø å!
Posted by KWood
|
Problems with danish æ ø å! November 01, 2008 03:25PM |
Registered: 17 years ago Posts: 30 |
Hi
I am trying to integrate Phorum with my on login script, but I have a problem with user creation.
From another tread I got this code:
Language: PHP<?php
chdir('/home/...../phorum_5_2');
define('phorum_page','create_user');
include_once("./common.php");
phorum_api_user_save(array(
'user_id' => NULL,
'username' => 'testing2',
'password' => 'coolpass',
'email' => 'testing2@example.com',
'real_name' => 'Test user',
'active' => PHORUM_USER_ACTIVE
));
?>
And it works super accept when usernames includes the danish characters æ ø or å. they end up in the database as "?".. what goes wrong? and how to fix it?
Kind regards KWood
I am trying to integrate Phorum with my on login script, but I have a problem with user creation.
From another tread I got this code:
Language: PHP<?php
chdir('/home/...../phorum_5_2');
define('phorum_page','create_user');
include_once("./common.php");
phorum_api_user_save(array(
'user_id' => NULL,
'username' => 'testing2',
'password' => 'coolpass',
'email' => 'testing2@example.com',
'real_name' => 'Test user',
'active' => PHORUM_USER_ACTIVE
));
?>
And it works super accept when usernames includes the danish characters æ ø or å. they end up in the database as "?".. what goes wrong? and how to fix it?
Kind regards KWood
|
Re: Problems with danish æ ø å! November 01, 2008 03:46PM |
Registered: 21 years ago Posts: 340 |
It's a problem with incompatible character sets. They need to be set the same for phorum, mysql, php and your webserver.
[www.phorum.org]
[www.phorum.org]
|
Re: Problems with danish æ ø å! November 01, 2008 04:16PM |
Registered: 17 years ago Posts: 30 |
|
Re: Problems with danish æ ø å! November 01, 2008 07:33PM |
Admin Registered: 21 years ago Posts: 8,532 |
Phorum uses UTF-8 by default. For Phorum, this is configured from the language file (there's a "CHARSET" variable in there). The database charset is configured in include/db/config.php, in the "charset" option ("utf8" by default).
I don't know where your main system configures its charset, but it might be ISO-8859-1 or so and not UTF-8. You'll have to change one of the charsets. It might be easiest to adjust Phorum to the charset of your application. If that one uses ISO-8859-1, then this involves changing the db charset configuration to "latin1" and to use a language file that is created as an ISO-8859-1 file.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
I don't know where your main system configures its charset, but it might be ISO-8859-1 or so and not UTF-8. You'll have to change one of the charsets. It might be easiest to adjust Phorum to the charset of your application. If that one uses ISO-8859-1, then this involves changing the db charset configuration to "latin1" and to use a language file that is created as an ISO-8859-1 file.
Maurice Makaay
Phorum Development Team
my blog
linkedin profile
secret sauce
|
Re: Problems with danish æ ø å! November 02, 2008 08:15AM |
Registered: 17 years ago Posts: 30 |
THANKS!!
That fixed it...but!!
next step: creating users in Phorum when they are created i the main system..
I have used the you made in another tread but get an error:
the code (with a change in sitename):
$curcwd = getcwd();
chdir("/hsphere/local/home/siteYY/siteXX/medlemv2/phorum");
define('phorum_page','create_user');
include("./common.php");
echo "Opret medlem";
/*phorum_api_user_save(array(
"user_id" => $idb, // or the user id from your main user database
"username" => $brugernavn,
"real_name" => $brugernavn,
"password" => $passencrypt,
"active" => $PH_status,
"hide_email"=> "TRUE",
"email" => $email1
));*/
chdir($curcwd);
the error:
Opret medlem Fatal error: main(): Failed opening required './include/db/.php' (include_path='.:/hsphere/shared/apache/libexec/php4ext/php/') in /hsphere/local/home/siteYY/siteXX/medlemv2/phorum/common.php on line 146
Its seems like it includes the common.php correctly but fails the create the variabels for the database (running the script under /phorum directly without using the chdir works fine...
HELP :-)
That fixed it...but!!
next step: creating users in Phorum when they are created i the main system..
I have used the you made in another tread but get an error:
the code (with a change in sitename):
$curcwd = getcwd();
chdir("/hsphere/local/home/siteYY/siteXX/medlemv2/phorum");
define('phorum_page','create_user');
include("./common.php");
echo "Opret medlem";
/*phorum_api_user_save(array(
"user_id" => $idb, // or the user id from your main user database
"username" => $brugernavn,
"real_name" => $brugernavn,
"password" => $passencrypt,
"active" => $PH_status,
"hide_email"=> "TRUE",
"email" => $email1
));*/
chdir($curcwd);
the error:
Opret medlem Fatal error: main(): Failed opening required './include/db/.php' (include_path='.:/hsphere/shared/apache/libexec/php4ext/php/') in /hsphere/local/home/siteYY/siteXX/medlemv2/phorum/common.php on line 146
Its seems like it includes the common.php correctly but fails the create the variabels for the database (running the script under /phorum directly without using the chdir works fine...
HELP :-)
|
Re: Problems with danish æ ø å! November 02, 2008 08:21AM |
Registered: 17 years ago Posts: 30 |
Sorry, only registered users may post in this forum.