Forum Moderators: coopster
Now the strange part: when i show the saved text into a form, it shows "................................."
in front of text (replenish . with space between "") in 3 of the 5 fields (the rest are ok). While in application the text appears correctly, in administration pages, the extra spaces prevents me from inserting a full 600 character length text.
I have echoed the $_POST data of the form, it's ok.
I have trimed the $_POST data of the form, no result.
I have echoed the data outside form field, all ok.
Try using trim($str,"\x7f..\xff\x0..\x1f"), no result.
Try using trim($str,"\n\t\r\h\v\0\x0B"), no reuslt.
What can be wrong and how can I fix it?.
As I remember, 32 is a standard space. If there was only letter 0 in there, then there was one space in the string, and nothing else - not even tabs or linebreaks. That's why I am now thinking about your output code.
inside form i have:
<td>Small Text <input readonly type=text name=ger size=3 maxlength=3 value="600"> chars left<br>
<textarea rows="5" name="german_small_text" cols="55" onKeyDown="textCounter(this.form.german_small_text,this.form.ger,600);" onKeyUp="textCounter(this.form.german_small_text,this.form.ger,600);">
<? echo trim($h_german_small_text);?></textarea>
</td>
You need to have:
...><? echo trim($h_german_small_text);?></textarea> Next - try to find out about your page encoding and your database encoding. If you change your page encoding in your browser to UTF-8 or something else, does the problem go away? If you are sending out your HTML in multibyte encoding, and your Database results in singlebyte encoding, it can cause problems like you complain of - same goes with the reverse.
And the problem still appeas in UTF8 encoding.
the data are saved correclty in db - appear correclty in front-end application.
only problem is the 3 out of 5 languages.
funny thing... i even try to use a loop to generate the textarea (so as to check if i have done something wrong (typo for example) and thus having problem in all 5 languages) - 2 languages worked correct, 3 do not.
example:
$lang_array = array("english", "greek", "french", "german", "italian");
foreach ($lang_array as $language)
{
// show <td>....</td>
}
Double/triple checked the db fields - all 5 are Longtext, Not Null.
Run repair on table in db
Execute script with error reporting set to E_ALL - nothig showed up (script is up and running for 6-7 months)
echoed every step of script to make sure all info/data are the same in every step - Yes they are the same as i typed them in textarea.
I know it it not a serious problem, I know that the solution must be an obvious one, but havent figured anyhting out.
Oh well... it must be one of those days.