On Mon, 20 Aug 2001 18:09:07 +0200
Robin Berjon <[EMAIL PROTECTED]> wrote:
> > Not that you should define "encode()" method as a class method.
>
> I assume you meant "Note" :-)
Oops. Thanks for fix.
> > CAVEATS
> > This module (at least Apache::ACEProxy::RACE) assumes input domain
> > names are encoded in UTF8. But currently it's known that:
> >
> > * MSIE's "always send URL as UTF8" preference does NOT ALWAYS send
> > correct UTF8 string.
>
> This has come up on the dav-dev list. As far as MS DAV clients are concerned,
> the User-Agent can be used to know whether or not it respects that setting.
> Of course, in order to do proper conversion when it doesn't respect it you
> still need to know the local encoding that it uses.
In my environment, User-Agent: strings is always
Mozilla/4.0 (compatible; MSIE 5.5; Windows 98; Win 9x 4.90)
It seems to be independent with whether that setting is enables.
The problem is, even if we enable the setting, MSIE sometimes sends
corrupted UTF-8 string. In my environment, delimiting dots in
domain names are corrupted as UTF-8.
> > So, this proxy server doesn't always work well with all the domains for
> > all the browsers.
> >
> > Suggestions, patches and reports are welcome about this fact.
>
> Perhaps you could add a configuration directive to allow it to translate from
> local encodings (which the directive would specify) to UTF-8 ?
Agree. Or you should overload encode() easily, if you know how to
translate local encodings which your browser uses, to UTF8.
> I don't know
> how Unicode::String deals with bad encodings, but other conversion modules
> (eg Text::Iconv) just die. Perhaps wrapping the conversion in an eval {} in
> order to provide a nice error message to people that use broken browsers
> would be a good idea ?
Already done :-) Here's an excerpt from ACEProxy.pm.
# Encode hostname to ACE
my $uri = URI->new($r->uri);
my $ace_host;
eval {
$ace_host = join '.', map {
# RFC 1035: letter, digit, hyphen
/^[\x30-\x39\x41-\x5a\x61-\x7a\x2d]*$/ ?
$_ : $class->encode($_);
} split /\./, $uri->host;
};
if ($@) {
(my $exception = $@) =~ s/ at .*$//; chomp $exception;
require Apache::Log;
$r->log->error("Apache::ACEProxy: error happens while ACE conversion: $exc
eption");
return;
}
--
Tatsuhiko Miyagawa <[EMAIL PROTECTED]>