- 论坛徽章:
- 0
|
问题解决,原来这是Win32::IEAutomation的一个Bug,具体见如下描述:
Win32::IEAutomation uses Win32::OLE to all the work, but leaves its
option that specifies how to handle Perl UTF-8 stirngs set by default,
which makes Win32::OLE treat them as they were sequence of bytes in
Windows current ANSI codepage. This makes impossible to use UTF-8
strings in calls to SetValue() and other similar methods. Since IE (as
well as most other MS' own application) to support Unicode data from OLE
correctly, UTF-8 support in Win32::OLE should be enabled by
Win32::IEAutomation. This is backwards compatible change, as scripts
that try to use current CP pass strings as sequence of bytes and this
change only affect handling of "true" UTF-8 strings.
在IEAutomation.pm的代码
sub _startIE{
my ($self, $visible, $maximize) = @_;
defined $self->{agent} and return;
之后添加:
Win32::OLE->Option(CP=>Win32::OLE::CP_UTF ;
后,现测试完美解决。
谢谢大家,遇到同样问题的可以参考。
|
|