[wp-trac] [WordPress Trac] #19368: UTF-8 characters truncated mid-byte sequence in excerpt in RSS2 feed

WordPress Trac wp-trac at lists.automattic.com
Sun Nov 27 15:08:14 UTC 2011


#19368: UTF-8 characters truncated mid-byte sequence in excerpt in RSS2 feed
--------------------------+------------------------------
 Reporter:  kurtmckee     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Feeds         |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+------------------------------

Comment (by kurtmckee):

 Unfortunately I don't have a clean install, and after looking at the feed
 more carefully this morning the contents of the `description` element
 aren't even a consistent word count nor byte length. The problem with the
 feed is probably an issue with a plugin or theme customization, as you've
 noted.

 Before closing this ticket, is my concern about `trackback_url_list()`
 valid? The PHP documentation suggests that using `substr()` on a UTF-8
 string can produce truncated byte sequences. At
 [https://core.trac.wordpress.org/browser/trunk/wp-includes/post.php#L3092
 line 3092 in wp-includes/post.php]:

 {{{
 if (strlen($excerpt) > 255) {
     $excerpt = substr($excerpt,0,252) . '...';
 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/19368#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list