1 (edited by sara 2008-05-21 10:50)

Topic: bugs for non-english user

sorry for my english ,wish you will understand... smile


1. timezone

show wrong below (correct in phpbb and other popular programs)

set: (Administration)Server timezone +8 & (user Profile) timezone +8

may be wrong in /include/functions.php line 630

$diff = ($pun_user['timezone'] - $pun_config['o_server_timezone']) * 3600;

in my mind, Server timezone(var: $pun_config['o_server_timezone']) only affect default timezone set in registration.
so the code should modify to

$diff = $pun_user['timezone'] * 3600;

2. show utf8 character in database(for example: phpmyadmin)
if necessary...

/header.php

find

header('Pragma: no-cache');        // For HTTP/1.0 compability

add after

header("Content-Type: text/html; charset=utf-8");

/include/dblayer/mysql.php

find

return $this->link_id;

add before

mysql_query("SET NAMES utf8");
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET COLLATION_CONNECTION='utf8_general_ci'");

and
if you want to use multi language select...

/lang/english/common.php

find

/*
// Determine what locale to use
switch (PHP_OS)
{
    case 'WINNT':
    case 'WIN32':
        $locale = 'english';
        break;

    case 'FreeBSD':
    case 'NetBSD':
    case 'OpenBSD':
        $locale = 'en_US.US-ASCII';
        break;

    default:
        $locale = 'en_US';
        break;
}

// Attempt to set the locale
setlocale(LC_CTYPE, $locale);
*/

// Language definitions for frequently used strings
$lang_common = array(

// Text orientation and encoding
'lang_direction'        =>    'ltr',    // ltr (Left-To-Right) or rtl (Right-To-Left)
'lang_encoding'            =>    'iso-8859-1',
'lang_multibyte'        =>    false,

replace it

// Determine what locale to use
switch (PHP_OS)
{
    case 'WINNT':
    case 'WIN32':
        $locale = 'english';
        break;

    case 'FreeBSD':
    case 'NetBSD':
    case 'OpenBSD':
        $locale = 'en_US.UTF-8';
        break;

    default:
        $locale = 'en_US';
        break;
}

// Attempt to set the locale
setlocale(LC_CTYPE, $locale);


// Language definitions for frequently used strings
$lang_common = array(

// Text orientation and encoding
'lang_direction'        =>    'ltr',    // ltr (Left-To-Right) or rtl (Right-To-Left)
'lang_encoding'            =>    'UTF-8',
'lang_multibyte'        =>    true,

2

Re: bugs for non-english user

The UTF-8 part is not a bug. 1.2.* was just not UTF-8. smile Btw, setting the locale option explicitly can cause problems under certain circumstances, if I remember correctly.