On Wed, 07 Jul 2004 12:46:31 +0200, Michael Bell wrote
> I commited a fix for setLanguage. I have no problems - with an 
> without the patch. This is the new version.
> 
> sub setLanguage
> {
>      our $LANGUAGE = $_[0];
>      our $CHARSET  = $_[1];
>      setlocale(LC_MESSAGES, $LANGUAGE.".".uc ($CHARSET));
>      textdomain("openca");
>      bindtextdomain("openca", $AUTOCONF{"lib_prefix"}."/locale");
>      bind_textdomain_codeset ("openca", $CHARSET);
>      if (defined $log)
>      {
>          my $enc = $log->setEncoding ($CHARSET);
>          debug ("initServer: setLanguage: setEncoding for log return 
> $enc");     }     $ui_html->setLanguage ($LANGUAGE, $CHARSET) if 
> ($ui_html); }
> 
> Michael

I'm affraid a simple uppercase is not sufficient because the first hyphen is
getting in the way. It should be "ISO8859-1" instead of "ISO-8859-1".

I'm not close to a perl expert but something like this works:

sub setLanguage
{
    our $LANGUAGE = $_[0];
    our $CHARSET  = $_[1];
    ( $_ = $CHARSET) =~ s/^iso-/ISO/;
    setlocale(LC_MESSAGES, $LANGUAGE.".".$_);
[...]

This probably can be cleaned up and made more readable...

Kind regards,
Nuno Antunes


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
OpenCA-Devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/openca-devel

Reply via email to