Messaging: Problems with 1.6 and special chars

Messaging: Problems with 1.6 and special chars

ដោយ Eduardo Hernandez នៅ
ចំនួនតប៖ 7

Hello!

We have just installed Moodle 1.6 and when we use any special char from Spanish such á é or ñ the message is truncated exactly where the first special char appears.

I have been searching the forum but can't seem to find the answer. Anyway I have added it to the bug tracker (6128)

Eduardo

មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ Eduardo Hernandez

(probably solution) Re: Problems with 1.6 and special chars

ដោយ Eduardo Hernandez នៅ

I was looking in the source code, and in file send.php and in line 39 says

$message  = optional_param('message', '', PARAM_CLEANHTML);

I changed it to

$message  = optional_param('message', '', PARAM_RAW);

and now it works....

I don't know if this is a final solution but it works

Eduardo

មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ Eduardo Hernandez

Re: (probably solution) Re: Problems with 1.6 and special chars

ដោយ Séverin Terrier នៅ
រូបភាព Documentation writers រូបភាព Particularly helpful Moodlers រូបភាព Testers រូបភាព Translators
Hello,

it seems that this bug is still (sometimes ?) here ក្រៀមក្រំ
... the code is still the same...

In fact, i have 2 Moodle (1.6.2) installed on 2 different servers, one with no problem and one with this problem pensif

I've seen that for the one with problem, i have in the apache server configuration (httpd.conf) this line :
AddDefaultCharset ISO-8859-1

If i comment it, the problem disapear...

But i think that Moodle should'nt rely on apache configuration !
មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ Séverin Terrier

Re: (probably solution) Re: Problems with 1.6 and special chars

ដោយ Olivier CATTEAU នៅ
Hi all,
messaging works fine with Moodle 1.6.2+ I've just installed.

But... I ran the Moodle database Migration script, and the special chars problem appears!

Best regards.
មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ Olivier CATTEAU

Re: (probably solution) Re: Problems with 1.6 and special chars

ដោយ Olivier CATTEAU នៅ
Hi again,
I'm not sure that's the right solution, but it works!

File message/send.php, lines 64 & 65:
    /// Save it to the database...
        $messageid = message_post_message($USER, $user, addslashes(utf8_encode($message)), $format, 'direct');

File message/refresh.php, line 64:
      $printmessage = str_replace("\n", ' ', $printmessage);
      $printmessage = utf8_decode($printmessage);

Regards.
មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ Olivier CATTEAU

Re: (probably solution) Re: Problems with 1.6 and special chars

ដោយ Bernd G. Schleicher នៅ
Hi Olivier!

It works for me, too! Great job. Many thanks!

Best regards
មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ Bernd G. Schleicher

Re: (probably solution) Re: Problems with 1.6 and special chars

ដោយ Robert Allerstorfer នៅ
It does not work for me in 1.7.1+. I have updated http://tracker.moodle.org/browse/MDL-6128
but wasn't able to re-open the ticket. Also, when trying to paste the first screenschot via the java applet, it somehow broke the image. It should still be ckear, however, which problem we observe.
មធ្យមភាគនៃរង្វាយតម្លៃ: -
ឆ្លើយតបទៅកាន់ Robert Allerstorfer

Re: (probably solution) Re: Problems with 1.6 and special chars

ដោយ Robert Allerstorfer នៅ
I have posted the fix at the thread
"Bug and fix in 1.7.1 (probably also older versions) for displaying Non-ASCII chars"

regards,
rob.
មធ្យមភាគនៃរង្វាយតម្លៃ: -