View Single Post
Old 09-28-2009, 05:08 PM   #37 (permalink)
BMW
All Star Starter
 
BMW's Avatar
 
Join Date: May 2003
Location: New Jersey
Posts: 1,471
Thanks: 125
Thanked 493x in 204 posts
Quote:
Originally Posted by Getch View Post
The number sorting thing was fixed a while back. Make sure you have the latest version.

As for the character issue, yeah. It's known. Markus changed the encoding on the csv files. I bugged him about it but haven't heard back.
Getch, I put this function in the Utils (it's messy as I know nothing about PERL, but it does the job for every generated name in my league right now):

Code:
sub convertAscii {
    my ($text) = @_;

        my $HEXa0;
        $HEXa0 = "a0";
        $HEXa0 =~ s/([a-fA-F0-9]{2})/chr(hex $1)/eg;
        $HEXa0 = 'Ã' . $HEXa0;

        my $HEX81;
        $HEX81 = "81";
        $HEX81 =~ s/([a-fA-F0-9]{2})/chr(hex $1)/eg;
        $HEX81 = 'Ã' . $HEX81;

        $text =~ s/$HEXa0/à/g;
        $text =~ s/á/á/g;
        $text =~ s/ã/ã/g;
        $text =~ s/é/é/g;
        $text =~ s/Ã*/í/g;
        $text =~ s/ó/ó/g;
        $text =~ s/ú/ú/g;

        $text =~ s/$HEX81/Á/g;
        $text =~ s/É/É/g;

        $text =~ s/ç/ç/g;
        $text =~ s/ñ/ñ/g;

    return $text;
}
You just need to reference it any time you are about to put a name field into the HTML (which is an awful lot of places, or course).
BMW is offline   Reply With Quote