Solving special characters "false" error.

Post Reply
wiz
Admin
Posts: 481
Joined: Sat Oct 30, 2010 12:23 am

Solving special characters "false" error.

Post by wiz »

I've managed to find a way to solve some special characters (I think all of them from the dwfee's list in this post) and the © stays the same at all times. (doesn't turn into any weird code).

NOTE: This still doesn't fix Chinese, Japanese and Slovenian characters (on some servers). Although some users successfully used Greek, Hebrew and Arab characters without any problems.

How to fix it?

Open up editText.php and add the following line of code

Code: Select all

$content = mb_convert_encoding($content,"UTF-8");
above this code

Code: Select all

fwrite($file, $content);
fclose($file);
So the end result will be:

Code: Select all

$content = mb_convert_encoding($content,"UTF-8");

fwrite($file, $content);
fclose($file);
Or just download the editText.php attached to this post and replace it with the original one.
Attachments
editText.zip
(1.03 KiB) Downloaded 730 times
xss
Support/Developer
Posts: 22
Joined: Thu May 26, 2011 9:07 pm

Re: Solving special characters "false" error.

Post by xss »

rob wrote:NOTE: This still doesn't fix Chinese, Japanese and Slovenian characters (on some servers). Although some users successfully used Greek, Hebrew and Arab characters without any problems.
I still suspect these issues might be somehow caused by the way the OSes or the browsers handle special characters, possibly additionally influenced by something in the JavaScript-ish editor box (at least that's where the conversion from HTML entities like „ä“ to characters like „ä“ (and, before your fix, also from „ä“ to some erroneous character) seems to happen – well, that's what it looks like to me, but I might be wrong...). My reasoning is that I work on Ubuntu Linux, and most of the „exotic“ languages seem to be supported out-of-the-box via some Unicode related package. And I remember from back in my Windows days, that I often came across strange encoding issues with texts interchanged between Windows and Linux platforms, that looked fine in Linux but were displayed weirdly in Windows. And I remember installing several Microsoft language support packages for certain Asian languages and probably also Arabic and other languages.

In an attempt to confirm this, I just ran some tests editing Arabic, Chinese, Japanese and Slovenian text blocks in both my WonderCMS installations, using a virtual WinXP SP3 installation with IE8, a native WinXP SP3 installation with IE8, and my Linux box with FF 3.6 and Chromium 11. Unfortunately, I could not reproduce the desired issues. :( (But I came across some other issue, which I posted in its own thread...)

Anyway, back to topic, both my installations can handle Japanese, Arabic, Hebrew and Slovenian text, but strangely, only my home server can handle Chinese text. The WonderCMS installation at my webhoster's server results in „false“ when pasting Chinese characters.

rob, could this be helpful in solving this? Can I otherwise conclusively compare these two installations (I already sent you both phpinfo files a couple of days ago...)? Or what else could I try to help you get on top of this?

Kind regards,
xss
¿ן ʇ,uop 'spɹɐʍʞɔɐq ןןɐ ʇı ʇoƃ ן 'ɹɐǝp ɥo
wiz
Admin
Posts: 481
Joined: Sat Oct 30, 2010 12:23 am

Re: Solving special characters "false" error.

Post by wiz »

Xss, you've been one of the most helpful users so far. You could also help some more if you have an online server that doesn't support special characters with WonderCMS.

If you happen to do so, I'd love to have a test account and solve this problem, as I have a couple of new ideas (which come from users and developers like you).

Thanks so much for helping out on this problem.
xss
Support/Developer
Posts: 22
Joined: Thu May 26, 2011 9:07 pm

Re: Solving special characters "false" error.

Post by xss »

Hello rob,

I also just started with some testing on our test install. And I can reproduce one of these "false" errors.

I took Chinese text from this site: http://www.google.cn/intl/zh-CN/privacy/

Pasting only Chinese characters is not a problem. But as soon as certain punctuation signs are entered as well, the page content is reduced to 'false'. (Right about now an undo possibility would be useful. ;)) The Chinese periods (。) seem to be no problem, but the comma-like (,) and colon-like (:) characters are, for example, possibly also others. Can you reproduce that, rob? If not, it might be related to some inter-OS unicode issue.

Kind regards,
xss
¿ן ʇ,uop 'spɹɐʍʞɔɐq ןןɐ ʇı ʇoƃ ן 'ɹɐǝp ɥo
wiz
Admin
Posts: 481
Joined: Sat Oct 30, 2010 12:23 am

Re: Solving special characters "false" error.

Post by wiz »

Thanks for the feedback again Xss, I'm on it as (,:) didn't work on my test either.
barrymorgan88
Posts: 1
Joined: Mon Jan 23, 2012 6:31 pm

Re: Solving special characters "false" error.

Post by barrymorgan88 »

Thanks for the info. I have been looking everywhere for something like this, and it is exactly what I needed. Thanks a lot :)
rob wrote:I've managed to find a way to solve some special characters (I think all of them from the dwfee's list in this post) and the © stays the same at all times. (doesn't turn into any weird code).

NOTE: This still doesn't fix Chinese, Japanese and Slovenian characters (on some servers). Although some users successfully used Greek, Hebrew and Arab characters without any problems.

How to fix it?

Open up editText.php and add the following line of code

Code: Select all

$content = mb_convert_encoding($content,"UTF-8");
above this code

Code: Select all

fwrite($file, $content);
fclose($file);
So the end result will be:

Code: Select all

$content = mb_convert_encoding($content,"UTF-8");

fwrite($file, $content);
fclose($file);
Or just download the editText.php attached to this post and replace it with the original one.
Last edited by barrymorgan88 on Sun Jan 29, 2012 11:05 pm, edited 1 time in total.
wiz
Admin
Posts: 481
Joined: Sat Oct 30, 2010 12:23 am

Re: Solving special characters "false" error.

Post by wiz »

barrymorgan88 wrote:Thanks for the info. I have been looking everywhere for something like this, and it is exactly what I needed. Thanks a lot :)
I'm glad it helped and you're welcome. :)
Post Reply