[Typo3-dev] crop whole words and utf-8

Wolfgang Klinger wolfgang at stufenlos.net
Fri Nov 11 15:09:13 CET 2005


 Hi!

 On Fri, 11 Nov 2005, Toni Milovan wrote the following:
> I was just looking at API doumentation and there is:
> 
> 01414         function crop($charset,$string,$len,$crop='')   {
> 01415                 if (intval($len) == 0)  return $string;
> 01416 
> 01417                 if ($charset == 'utf-8')        {
> 01418                         $i = $this->utf8_char2byte_pos($string,$len);
> 01419                 } elseif ($this->eucBasedSets[$charset])        {
> 01420                         $i = $this->euc_char2byte_pos($string,$len,$charset);
> 01421                 } else {
> 01422                         if ($len > 0)   {
> 01423                                 $i = $len;
> 01424                         } else {
> 01425                                 $i = strlen($string)+$len;
> 01426                                 if ($i<=0)      $i = false;
> 01427                         }
> 01428                 }
> 
> Shouldn't this take care of the utf-8 problem?

 I don't know where you found this API documentation but that's not part
 of the code of the TYPO3 3.8 release.


 kind regards
 Wolfgang





More information about the TYPO3-dev mailing list