1 (edited by days 2005-01-29 18:47)

Topic: thai character is missing when post

Dear;

I use punbb 1.2 when i preview the message It is ok but when posted , Some character  missing, not display . Thai character that missing is  "Sor Sur" on  L botton of keyboard, below is my config in common.php


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

    case 'FreeBSD':
    case 'NetBSD':
    case 'OpenBSD':
        $locale = 'th_TH.TIS-620';
        break;

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

// Attempt to set the locale (required for fulltext indexing to work correctly)
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'            =>    'Tis-620',
'lang_multibyte'        =>    false,


Note:

  1.   I  translate into Thai languge by myself  and I try to use Thai language pack  by skinmaker123 also. It has the same  problem
  2.  Thai character in message box displays ok, not missing when i change the language to English but others   thai text like as Menu  can not display thai, It has not human language so i like setting it to Thai much more, others thai text display well

Please help me

Thanks

2

Re: thai character is missing when post

This is my site

http://www.thailaos.com/support/

Re: thai character is missing when post

Open up your include/functions.php and make sure replace your pun_trim function with this:

function pun_trim($str)
{
        global $lang_common;

        if (strpos($lang_common['lang_encoding'], '8859') !== false)
        {
                $fishy_chars = array(chr(0x81), chr(0x8D), chr(0x8F), chr(0x90), chr(0x9D), chr(0xA0), chr(0xCA));
                return trim(str_replace($fishy_chars, ' ', $str));
        }
        else
                return trim($str);
}

This fix will be incorporated into 1.2.1. You have to re-post any messages to see the effects of the fix.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

4 (edited by days 2005-01-30 02:15)

Re: thai character is missing when post

Good Jobs !

I have edited the filenames function.php as you provide and test it again and agian by post many message
It 's now OK. Thai text can display very good

your support is the best
Thank you very much Mr.Rickard