excerpt support Chinese characters
-
Hi,
I am trying this plug, but I found that this plug cannot handle Chinese characters well. I try to find the possible solution for it. I found one solution for the similar issue.
Find /wp-includes/formatting.php
if ( strpos( _x(‘words’, ‘Word count type. Do not translate!’ ), ‘characters’ ) === 0 && preg_match( ‘/^utf\-?8$/i’, get_option( ‘blog_charset’ ) ) ) {
$text = trim( preg_replace( “/[\n\r\t ]+/”, ‘ ‘, $text ), ‘ ‘ );
preg_match_all( ‘/./u’, $text, $words_array );
$words_array = array_slice( $words_array[0], 0, $num_words + 1 );
$sep = ”;
} else {
$words_array = preg_split( “/[\n\r\t ]+/”, $text, $num_words + 1, PREG_SPLIT_NO_EMPTY );
$sep = ‘ ‘;
}
Change ‘words’ to ‘characters_excluding_spaces’ or ’characters_including_spaces’.Can we have the feature added to this plug? thanks.
- The topic ‘excerpt support Chinese characters’ is closed to new replies.