[pmwiki-users] Make xlpage-utf-8.php free from mbstring module?
Patrick R. Michaud
pmichaud at pobox.com
Thu Sep 15 23:43:50 CDT 2005
On Fri, Sep 16, 2005 at 12:28:06PM +0800, Elias Soong wrote:
> If we use utf-8 coding in pmwiki, the xlpage-utf-8.php require the
> php module mbstring actived. Some host like mine not use mbstring, so we
> should work aroud it.
> I found in the 36th line of xlpage-utf-8.php, could set which
> PageNameFunction will be used. If I simply set "$MakePageNameFunction =
> '';", then the xlpage-utf-8.php won't call any mbstring functions, and
> the pmwiki could work.
> My question is, when I set MakePageNameFunction to be none, what is
> the effect of this? Obviously, WikiWord with non-ASCII will not work. Is
> there any other side effects?
Setting $MakePageNameFunction to an empty string causes it to
use PmWiki's built-in MakePageName function. The built-in uses
PHP's strtoupper() function, which doesn't know what to do with
UTF-8 characters.
So, if you're willing to live with PmWiki being unable to properly
uppercase non-ascii first letters of words in pagenames, it's
probably okay. But it means that something like [[édition]] would
result in an invalid pagename, because (in UTF-8) strtoupper()
doesn't know how to convert the "é" into an uppercase equivalent.
I've been thinking about adding a special-purpose UTF-8 capable
"strtoupper" function to be used in the xlpage-utf-8.php script,
to be able to avoid the need for the mbstring functions altogether.
I'll be glad to work on that now if you're willing to help test
it... :-)
Pm
More information about the pmwiki-users
mailing list