Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hey there,

I've used CouchCMS for many of my sites now - never had any issues or bugs to report that I couldn't work around. But now somehow one little tricky bug gets me running in circles. So here it is:

My client typed in "90m²" in a textarea field and out came "90m²". First I thought it might be a charset-error or whatever, but the charset is ok and set to UTF-8 and all the other special characters are ok though. Then I clicked the source-button and realized that somehow CouchCMS is creating an "²" instead of an "²" - it seems like the ampersand is generated as it should, if it would stand alone, and the rest goes through as pure text.

I've searched and tried to fix the functions.php but somehow none of my attempts worked out. Any suggestions how we can eradicate this?

Thanks so far!
Car
Hi Car,

Please try the following -
Select and copy the following string and paste it into the textarea. Save and see what you get.
My client typed in "90m²" in a textarea field

I tried it on my system and the text above came out just fine.
Please try it on your machine and let me know if it results in the problem you mentioned.

Let me know.
Thanks.
Thanks for the fast reply!
I tried what you suggested and this is the result of it:

Code: Select all
<p>My client typed in &quot;90m&amp;sup2;&quot; in a textarea field</p>


The quotes are displaying fine. It still throws me out an &amp;sup2; instead of an &sup2; though.
BTW: If I try to edit the squared sign through Firebug, it immediately displays me the "²" correctly.

Any further suggestions? May there be something wrong with the charset within the functions.php or the HTMLParser.php?

Thanks!
Car
Hi Car,

The output you posted has the string wrapped in <p></p>. This suggests that the editable region you are testing it in is of type 'richtext' and not 'textarea' as you originally mentioned.

I tested it in 'richtext' and, yes, the problem occurs.
If, however, you test the same string in 'textarea', you'll find that the problem does not manifest there.

This suggests that CKEditor (the richtext editor) has something to do with this phenomenon.

As a workaround, if you click the 'source' button of CKEditor and paste the original string in there and save, you'll find that now it behaves exactly like textarea.

I know it's a clumsy workaround but, I'm afraid, that's all we can do at the moment.

Hope it helps.
KK wrote: The output you posted has the string wrapped in <p></p>. This suggests that the editable region you are testing it in is of type 'richtext' and not 'textarea' as you originally mentioned.


Damn - sorry! Guess I was so confused by trying to solve this problem, that i didn't noticed this.

Yeah, so there is a sup button, too, that puts the selection in a sup-tag. That should work for now.
But big thanks for your help, anyways!
5 posts Page 1 of 1
cron