From: Thijs K. <ki...@sq...> - 2005-05-30 08:32:52
|
Hello Tomas, On Mon, May 30, 2005 09:31, Tomas Kuliavas wrote: > Attached two possible patches. wrapping.diff written for utf-8 and some > other multibyte charsets and uses extra function to detect charsets > supported by mbstring extension. wrapping2.diff written only for utf-8. Looks good. I prefer the solution that supports several mb charsets. Better solve it right the first time. Some small nitpicks about your patch: > function sqWordWrap(&$line, $wrap, $charset='') { I would use $charset = null if you're going to use the default value only to test whether it is set. This is a semantic thing only: null has a meaning of "not supplied" where empty string does not. The comment for sq_strlen has an incomplete @since tag if you want to add this to stable. > * This function provides replacement for function that is available only > * in php 5.x. Maybe somewhere at the start of that function you can test for the availability of mb_list_encodings and then return that directly? We don't officially support PHP5 yet but we will in the future. Better use its features if possible. > sqWordWrap($rewrap_body[$i], ($editor_size), $default_charset); This has too many parentheses around $editor_size. Regards, Thijs |