[dokuwiki] UTF8 utils for PHP

  • From: "Alexander A. Sorkin" <kibizoid@xxxxxxxxx>
  • To: dokuwiki@xxxxxxxxxxxxx
  • Date: Sun, 18 Jun 2006 23:56:33 +0400

Hello, guys!

Abstract: PHP String handling class for utf-8 data

I've been working on correcting some plugins today and found several
problems, for example in subscription mails with non roman characters.

The problem is following - UTF8 char takes 6 places, but e-mail is
hard formatted to 75 character width style. As a result almost all
messages from DokuWiki arrive broken:

> Новая версия    : h
> ttp://kibi.ru/wiki/doku.php/installjacija_dokuwiki
> 
> Сводка измене
> ний : 
> 
> Пользователь  
>            : kibi
>
> @@ -49,14 +49,13 @@
> 
>   Добавляет по?
> »е для созданиэ
> Џ новой страниэ
> †ы: {{NEWPAGE}}
> 
>
>     * Страница о пл
>агине - [[doku>>plugin:addnewpage]]
> 

The reason of such behavior is PHP string routines without UTF8
support.

I've tried to find set of rewritten PHP functions and have succeeded -
http://dev.joomla.org/index.php?option=com_jd-wiki&Itemid=31&id=guidelines:utf-8

Future version of CMS Joomla 1.5 comes with JString API

/**
 * String handling class for utf-8 data
 * Wraps the phputf8 library
 * All functions assume the validity of utf-8 strings. If in doubt use TODO
 *
 * @author David Gal <david@xxxxxxxxxxxx>
 * @package JoomlaFramework
 * @since 1.1
 */

I've already applied some code from that package while improving BackLinks 
plugin
http://chimeric.de/dokuwiki/plugins/backlinks

-- 
Best regards,
    _,    _                                 __,
   / |   //                      /         (            /  o
  /--|  // _  _.,  __,  _ _   __/ _  _      `.  __ _   /< ,  _ _
_/   |_(/_(/_/ /\_(_/(_/ / /_(_/_(/_/ (_  (___)(_)/ (_/ |_(_/ / /_
                                                __  ,                
                                      /        ( /,/ o  / o
       kibizoid@xxxxxxxxx       __,  /<  __,    /<  ,  / ,           
       http://kibi.ru          (_/(_/ |_(_/(_  /  \_(_/_)(_          

-- 
DokuWiki mailing list - more info at
http://wiki.splitbrain.org/wiki:mailinglist

Other related posts: