Index: trunk/extensions/Transliterator/Transliterator.php |
— | — | @@ -298,6 +298,7 @@ |
299 | 299 | |
300 | 300 | $sensitive = isset( $map["__sensitive__"] ); // Are we in case-sensitive mode, or not |
301 | 301 | $ucfirst = false; // We are in case-sensitive mode and the first character of the current match was upper-case originally |
| 302 | + $last_upper = null; // We have lower-cased the current letter, but we need to keep track of the original (dotted I for example) |
302 | 303 | $withstart = false; // Have we inserted a start character into the current $current |
303 | 304 | |
304 | 305 | $output = ""; // The output |
— | — | @@ -354,12 +355,13 @@ |
355 | 356 | if ( $last_letter != $last_lower ) { |
356 | 357 | $ucfirst = true; |
357 | 358 | $letters[$last_match] = $last_lower; |
| 359 | + $last_upper = $last_letter; |
358 | 360 | |
359 | 361 | // Might be nice to output a ? if we don't understand |
360 | 362 | } else if ( isset( $map[''] ) ) { |
361 | 363 | |
362 | 364 | if ( $ucfirst ) { |
363 | | - $output .= str_replace( '$1', mb_strtoupper( $last_letter ), $map[''] ); |
| 365 | + $output .= str_replace( '$1', $last_upper , $map[''] ); |
364 | 366 | $ucfirst = false; |
365 | 367 | } else { |
366 | 368 | $output .= str_replace( '$1', $last_letter, $map[''] ); |
— | — | @@ -371,7 +373,7 @@ |
372 | 374 | } else { |
373 | 375 | |
374 | 376 | if ( $ucfirst ) { |
375 | | - $output .= mb_strtoupper( $last_letter ); |
| 377 | + $output .= $last_upper; |
376 | 378 | $ucfirst = false; |
377 | 379 | } else { |
378 | 380 | $output .= $last_letter; |