Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: taka on January 02, 2006, 05:48:08 PM

Title: Proposed I18N fix for non-break space and e-mail encoding issues
Post by: taka on January 02, 2006, 05:48:08 PM
Hi.

I've fixed following issues and attached proposed fixes at the URL in the end of this message.


These issues have been found and reported as following topics:

http://www.simplemachines.org/community/index.php?topic=53070.0 (http://www.simplemachines.org/community/index.php?topic=53070.0)
http://www.simplemachines.org/community/index.php?topic=62907.0 (http://www.simplemachines.org/community/index.php?topic=62907.0)

For non-break space fix, it checks the current charset encoding being used, and if it's UTF-8, it ignores \xA0.  Otherwise, it assumes it's Latin encoding and replace them.  In other words, unless you change the charset to UTF-8 in Settings.php, it doesn't do anything.

For the e-mail fix, it takes advantage of PHP's standard mbstring library if it's available.  It can be enabled/disabled thru modSettings['use_mbstring'].

http://hiko-ki.com/patch_20060102.zip (http://hiko-ki.com/patch_20060102.zip)

NOTE: The zip file contains modified 1.1 RC1 files.
Title: Re: Proposed I18N fix for non-break space and e-mail encoding issues
Post by: spiros on January 02, 2006, 06:19:16 PM
Taka,

Yes, I can see what it does, it does not corrupt the last character in latest posts. In this message there is a hack for this too, but I have a feeling you have done more detective work.

Now if you can help with the problem with RC2 that would be great!