1 (edited by XuMiX 2005-01-08 12:35)

Topic: [1.2] Some national characters are stripped out of posts

Strange thing. this happens on my server, but this is not repeated here. So when i post a reply or just a new post with russian character "?", exactly this small character is completely stripped out from post, even when i try to edit it - there are no these characters at all.
but when i preview my post "?" is present there :(.
My server and punbb charset is koi8-r, there were no such problems in 1.1.5 version.

Re: [1.2] Some national characters are stripped out of posts

Are you running MySQL or PostgreSQL?

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

3 (edited by XuMiX 2005-01-08 14:18)

Re: [1.2] Some national characters are stripped out of posts

i'm running postgres, punbb database locale is set to koi8
maybe i should change it to unicode or latin1 ? apache  server charset is koi8, server itself locale is set to koi8 also

4

Re: [1.2] Some national characters are stripped out of posts

well, it seems to me, that DB does not affect this bug
i tried SQL_ASCII, UNICODE and KOI8 encodings

Re: [1.2] Some national characters are stripped out of posts

Well, if the database encoding differs from that of your XHTML page, I believe there will be problems.

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

Re: [1.2] Some national characters are stripped out of posts

Did you try inserting new posts after you changed the database locale?

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

7

Re: [1.2] Some national characters are stripped out of posts

function pun_trim($str)
{
    $fishy_chars = array(chr(0x81), chr(0x8D), chr(0x8F), chr(0x90), chr(0x9D), chr(0xA0), chr(0xCA), ' ');

    return trim(str_replace($fishy_chars, ' ', $str));
}

chr(0xCA) - That's it smile

Re: [1.2] Some national characters are stripped out of posts

Aha. Weird. That usually isn't a printable character at all. I'll fix it for 1.2.1.

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

9

Re: [1.2] Some national characters are stripped out of posts

I have the same problem with the russian letter K . I'm ussing MySQL.

Re: [1.2] Some national characters are stripped out of posts

1899: Try replacing 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);
}
"Programming is like sex: one mistake and you have to support it for the rest of your life."