Integrate Utf8_XH into the core

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!
Post Reply
cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Integrate Utf8_XH into the core

Post by cmb » Mon Feb 02, 2015 1:03 pm

Hello Community,

with CMSimple_XH 1.5.4 we had added the Utf8_XH plugin to the standard distribution of CMSimple_XH, and the core uses it unconditionally since then.

Originally, I thought that the functionality of the underlying PHP UTF-8 library would be useful for other PHP projects, too, but apparently it is not. To save me some work, I have released the latest versions (0.5.4 and 0.5.5) solely for CMSimple_XH.

As it is, the core has a hard coded dependency on the Utf8_XH plugin, what is bad. The only reason not to integrate it into the core would be improvements to the plugin that would be used by other plugins, so the plugin could be updated separately from the core. However, I don't have the time to develop new functionality, and the plugin is not widely used by other plugins, so I suggest that we integrate the relevant functionality of Utf8_XH into the core of CMSimple_XH 1.7. Eventually necessary bug fixes should be delivered for the plugin until the end-of-life of the XH 1.6 branch.

If we decide on requiring at least PHP 5.3 for XH 1.7, we may consider to evaluate Patchwork-UTF8 as an replacement for the current functionality. This library seems to be more feature complete, and is likely to be better optimized.
Christoph M. Becker – Plugins for CMSimple_XH

Tata
Posts: 3586
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia
Contact:

Re: Integrate Utf8_XH into the core

Post by Tata » Mon Feb 02, 2015 4:20 pm

+1
Last edited by cmb on Tue Mar 31, 2015 12:35 pm, edited 1 time in total.
Reason: fixed broken markup
CMSimple.sk
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Integrate Utf8_XH into the core

Post by cmb » Thu Apr 30, 2015 10:32 pm

cmb wrote:If we decide on requiring at least PHP 5.3 for XH 1.7, we may consider to evaluate Patchwork-UTF8 as an replacement for the current functionality. This library seems to be more feature complete, and is likely to be better optimized.
I had a somewhat more closer look at Patchwork-UTF8 in the meantime, and it seems to be very comprehensive and well designed. However, the latest release (1.2.0) requires 3.5 MB disk space -- not much nowadays, but rather much for CMSimple. It appears that much of the size is caused by conversion tables for a lot of charsets, what might not be relevant for CMSimple_XH. It might be possible to strip a lot of these data, but that might put a maintenance burden on ourselves. I'm not sure.

Then again, the relevant functionality of the Utf8 plugin (i.e. what's in use already) doesn't seem to be much, so it might be affordable to maintain it ourselves, especially if we throw away the "native PHP" implementation, relying on mbstring (which seems to be widely available nowadays). Maybe switching to a class (similar to UString) instead of a bunch of functions might be a good idea. Anyhow, putting all the required functionality in a single file for easier usage seems to be an improvement.
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Integrate Utf8_XH into the core

Post by cmb » Tue May 05, 2015 1:52 pm

I have created the utf8 feature branch, moved the most relevant functions of the Utf8_XH plugin into the core and removed the Utf8_XH plugin. As I have removed the native fallback implementations, the core now depends on the mbstring extension. Several of the utf8_* functions are only tiny wrappers around the respective mb_* functions, but I suggest to stick with the wrappers, because they're hiding the $encoding parameter (which seems to be required to avoid threading issues), and because we might have to bring back the native fallbacks, if we'll find that mbstring isn't supported widely enough.

I propose to vote about merging r1596.
Christoph M. Becker – Plugins for CMSimple_XH

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Integrate Utf8_XH into the core

Post by cmb » Mon Jun 01, 2015 1:41 pm

Done (r1626).
Christoph M. Becker – Plugins for CMSimple_XH

Post Reply