logo       

Re: Substr function and unicode: msg#00037

web.vtigercrm.devel

Subject: Re: Substr function and unicode

Hi Denys,

To use mb_strlen and mb_substr you need to enable mb_string php extension.

Also check out this library: http://phputf8.sourceforge.net/ which has wrapper functions: http://phputf8.sourceforge.net/#String_Functions

If you work with this, kindly let us know your observations in more details.

Good luck.

Regards,
Prasad


On 3/25/08, ????? ??????? <denis0712-JGs/UdohzUI@xxxxxxxxxxxxxxxx> wrote:
Hi all!


I'm using vtiger CRM 5.0.4 with Russian language Pack.

I've noticed a bug in "\modules\Leads\ListViewTop.php" on line 115:

        $Top_Leads = (strlen($lead['leadname']) > 20) ?
(substr($lead['leadname'],0,20).'...') : $lead['leadname'];

Neither "substr" nor "strlen" work correct with Unicode chars.

I found a solution, to use mb_strlen and mb_substr. Is it suitable to use
this functions or there are some other suggestions how to fix it?






Best regards,
Denys Potapov

_______________________________________________

Reach hundreds of potential candidates - http://jobs.vtiger.com

_______________________________________________
Reach hundreds of potential candidates - http://jobs.vtiger.com
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise