Posts: 5
Threads: 1
Joined: Apr 2011
Hey!
First of all, I want to say "Thank You!" for this really great script!!
I've tested the Script on my Website for more than two weeks but no visitor left a comment..
Now, I know the Problem. You can't submit a comment which includes ö's, ä's, ü's....
Error Report: 'The comment entered was too short. Please enter a longer comment.'
In the german language we often use words which includes mutated vowels (correct translation?!).
So this is a real problem.
Do you have any idea how to fix this problem?
Please let me know.
Kind regards
Peter
Posts: 2,894
Threads: 59
Joined: Jun 2010
Hi,
This likely means that your page is not UTF-8 encoded.
Did you add the UTF-8 charset inside your head tag? Take a look at the integration guide and the example files to see how this should be done.
You can check the encoding in Firefox using Tools -> Page Info.
Have
you completed
the interview?
Posts: 5
Threads: 1
Joined: Apr 2011
Thanks for this quick answer.
Now I've added the UTF-8 charset inside the head tag.
But I can't insert mutated vowels in the "Name" and "Town" field.
I didn't find any option to change this at the admin panel.
In the script I've found this:
Quote:function cmtx_validate_name ($name) { //checks whether name was valid
if (cmtx_is_encoding_iso($name)) { //if encoding is ISO-8859-1
if (!preg_match('/^[a-z0-9&\-\'. ]+$/i', $name) || !preg_match("/^[a-z]+/i", $name)) { //if the submitted name does not validate
cmtx_error(CMTX_ERROR_MESSAGE_INVALID_NAME); //reject user for entering invalid name
}
}
Is this the right part of the comment to fix this problem? =P
Posts: 2,894
Threads: 59
Joined: Jun 2010
Hi,
I'm not sure that anything needs "fixing" because mutated vowels work fine on the demo. I think that it's just a matter of getting the charset of your page to be UTF-8 but without being able to see your website I can't determine whether you have achieved that correctly.
Nevertheless if you want to edit the processing code then the relevant function for the error message that you posted is cmtx_comment_minimum.
Have
you completed
the interview?
Posts: 5
Threads: 1
Joined: Apr 2011
Hey Steven,
first the link to my website:
http://www.schelleklobber.de
The script is used as guestbook ("Gästebuch") and commentfunction ("Fotogalerie")
After adding this code (<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>) into the head-tag of every page, I converted the php-Files with Notepad++ into UTF-8 without BOM.
Posts: 2,894
Threads: 59
Joined: Jun 2010
It seems to be working now. I entered the following as a comment and it only produced errors about there being no name and email address.
Quote:fd fdd f ä ö ü ß ffwds
Have
you completed
the interview?
Posts: 5
Threads: 1
Joined: Apr 2011
I tested it one's again but I still have the problem that I can't insert a name or a town which includes mutated vowels...
I'm sure it's not a big deal to make mutated wovels possible for names and towns....
As long as it doesn't work, I'll add an advice in the error message.
Thanks a lot for your help!
This support is more than great and fast =)
Posts: 2,894
Threads: 59
Joined: Jun 2010
Hi,
I see what you mean now. I've been trying out a new solution:
In comments/includes/functions/processor.php, replace the
cmtx_is_encoding_iso function with this:
PHP Code:
<?php
function cmtx_is_encoding_iso ($entry) { //checks whether character encoding is ISO-8859-1
if (mb_check_encoding($entry, "ASCII")) {
return true;
} else {
return false;
}
} //end of is-encoding-iso function
Have
you completed
the interview?