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





--- Comment #3 from [email protected]  2009-03-07 22:11:21 UTC ---
I'm sure all the items in my Makefile could be done with PHP 'preg'
stuff and arrays.

Also you might want to add a normalization check if you don't have one
already.

Here's an example of normalization. Note it wouldn't catch the
characters mentioned earlier in this bug. Also you don't want to
convert blindly as here, but make a diff to catch them...

#!/usr/bin/perl
# use best Unicodes, at least so iconv -f utf8 -t big5
# won't hit any illegal chars.
# Copyright       : http://www.fsf.org/copyleft/gpl.html
# Author          : Dan Jacobson http://jidanni.org/
# Created On      : 2006
# Last Modified On: Wed Nov  5 08:54:53 2008
# Update Count    : 24
use strict;
use warnings FATAL => 'all';
use open qw/:std :encoding(utf8)/;
use Unicode::Normalize q(decompose);
while(<>){
    $_=decompose($_);
    s/没/沒/g;
    s/━/-/g;
    s/«/《/g; #ㄍ
    s/ / /g;
    print;
}
# Local Variables:
# compile-command: "echo 老老參參歷歷|normalize"
# End:



-- 
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