https://bugzilla.wikimedia.org/show_bug.cgi?id=12500

--- Comment #6 from Van de Bugger <[email protected]> 2011-11-23 18:14:54 
UTC ---
Non-printable characters can be handled in badCharErr:

> private static function badCharErr( $msgId, $point ) {
>     $char = codepointToUtf8( $point );
>     $code = sprintf( 'U+%04X', $point );
>     if ( preg_match( '/^[^:print:]/', $char ) ) {
>         $char = '';
>     }
>     return array( "ERROR", wfMsg( $msgId, $char, $code ) );
> }

Or:

> private static function badCharErr( $msgId, $point ) {
>     $char = codepointToUtf8( $point );
>     $code = sprintf( 'U+%04X', $point );
>     if ( preg_match( '/^[^:print:]/', $char ) ) {
>         return array( "ERROR", wfMsg( $msgId . '-np', $code ) );
>     }
>     return array( "ERROR", wfMsg( $msgId, $char, $code ) );
> }

(The latter variant will require some more error messages.)

Which variant do you prefer? I will prepare a new patch.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to