Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Imported From: http://groups.google.com/group/in-portal-bugs/browse_thread/thread/2a2ee5d35d079f8b#

V funkcii field db_tag_processor estj funkcionaljnost' pokaza

...

simvolov. (first_chars,cut_first) 

Code Block
$first_chars = $this->SelectParam($params,'first_chars,cut_first');

...

 
if($first_chars)

...

 
{ 
        $needs_cut = mb_strlen($value) > $first_chars;

...

 
        $value = mb_substr($value, 0, $first_chars);

...

 
        if ($needs_cut) $value .= ' ...';

...

 
} 

Dlja Vsex funkciy "mb_" neobxodimo vtorim parametrom peredavatj tekushju kodirovku, inache takie funkcii nepravilno schitajusj kolichesatvo simvolov pri ispolzoivanii jazika otlichnogo ot EN i posledniy simvol pered obrezkoy stroki pokazivajut v vide simpotichnoko kvadratika :) OSOBENNO v UTF-8 i UTF-16 (interesno kto nibudj ispoljzuet UTF-16 :) )

 Drugimi slovami nado dobavitj vtoroy parametr, v kotorm perdajetsja tekushaja kodirovka:

Code Block
$needs_cut = mb_strlen($value,'utf-8') > $first_chars;