| @@ 164-171 (lines=8) @@ | ||
| 161 | ||
| 162 | $encoding = self::getEncoding($encoding); |
|
| 163 | ||
| 164 | if ('UTF-8' === $encoding) { |
|
| 165 | $encoding = null; |
|
| 166 | if (!preg_match('//u', $s)) { |
|
| 167 | $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); |
|
| 168 | } |
|
| 169 | } else { |
|
| 170 | $s = iconv($encoding, 'UTF-8//IGNORE', $s); |
|
| 171 | } |
|
| 172 | ||
| 173 | $cnt = floor(\count($convmap) / 4) * 4; |
|
| 174 | ||
| @@ 226-233 (lines=8) @@ | ||
| 223 | ||
| 224 | $encoding = self::getEncoding($encoding); |
|
| 225 | ||
| 226 | if ('UTF-8' === $encoding) { |
|
| 227 | $encoding = null; |
|
| 228 | if (!preg_match('//u', $s)) { |
|
| 229 | $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); |
|
| 230 | } |
|
| 231 | } else { |
|
| 232 | $s = iconv($encoding, 'UTF-8//IGNORE', $s); |
|
| 233 | } |
|
| 234 | ||
| 235 | static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); |
|
| 236 | ||
| @@ 274-281 (lines=8) @@ | ||
| 271 | ||
| 272 | $encoding = self::getEncoding($encoding); |
|
| 273 | ||
| 274 | if ('UTF-8' === $encoding) { |
|
| 275 | $encoding = null; |
|
| 276 | if (!preg_match('//u', $s)) { |
|
| 277 | $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); |
|
| 278 | } |
|
| 279 | } else { |
|
| 280 | $s = iconv($encoding, 'UTF-8//IGNORE', $s); |
|
| 281 | } |
|
| 282 | ||
| 283 | if (MB_CASE_TITLE == $mode) { |
|
| 284 | $s = preg_replace_callback('/\b\p{Ll}/u', array(__CLASS__, 'title_case_upper'), $s); |
|