Sending pms returns empty title & body

Started by Yağız..., April 15, 2010, 07:29:40 PM

Previous topic - Next topic

Yağız...

I have edited vReportBoard Mod, now it sends a default pm to user who have reported when the topic is marked as solve etc etc. But the title and the body is empty ... I tried on my local and it sends the pm without any problem, but on my site, I have this problem :( My codes:
    $pms_body = 'Sorununuz çözümlenmiştir. Yine de kalan bir şey olduğunu düşünüyorsanız yukarıda yönetici grubuna mesaj atarak bize dönüş yapabilirsiniz.
Teşekkür ederiz.
{username}';
    $pm_words = array(
        '{username}',
    );   
    $pm_body = str_replace($pm_words, '[url=' . $scripturl . '?action=profile;u=' . $user_info['id'] . ']' . $user_info['name'] . '[/url]', $pms_body);
    $pm_body = un_htmlspecialchars($pm_body);

    $pmfrom = array(
        'id' => $user_info['id'],
        'name' => $user_info['name'],
        'username' => $user_info['username'],
    );
    $pmto = array(
        'to' => array($memberID),
        'bcc' => array()
    );

    if ($icon == 'solved')
        sendpm($pmto, 'Rapor ettiğiniz konu çözüldü.', $pm_body, 0, $pmfrom);

Arantor

*cough* Is one UTF-8 and the other not? *cough*

Yağız...

#2
Yes, UTF-8 :) Ah that's why, I got it :) So I shouldn't use turkish characters?


Wow, thank you again Arantor. But isn't it a bug?

Arantor

Not really, no, because what's happening is that the characters aren't UTF-8 but are being shoved into the DB as if they are. Consequently, when the page is rendered the not-really-UTF-8 kills the element.

The content needs to be UTF-8 when you call sendpm if the DB is UTF-8, iconv() can be used to convert between character encodings if necessary.

Yağız...

We changed Turkish characters with UTF-8 characters, no problem for now :)

Thank you again Arantor.

Advertisement: